How to improve wordpress mysql performance on large tables?

I’ve installed WordPress 5.4.1 on Ubuntu 20.04 LTS on AWS EC2 (free tier as I’m starting).

My instance has 30 GB of disk space and 1 GB of RAM.

My website has at about 9000 pages and I’ve imported 7800 so far with “HTML Import 2” plugin.

wp_posts table has 7,800 rows and 66 MB size and, since this table has grown, wordpress has become super slow. Any change I make to the database is super slow as well.

While trying to make changes, I keep getting this error:

Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/wordpress/wp-includes/wp-db.php on line 1626 No such file or directory

Error reconnecting to the database This means that we lost contact with the database server at localhost. This could mean your host’s database server is down.

What could I do in order to achieve a better speed and make it usable?

Improve querying of Extended Events target file

As part of our server estate monitoring, I am adding extended events to pick up warnings, blocking etc and I’d like to periodically (Every couple of minutes) query the event file to collect the data. I have been using the below to query data using xQuery, but it seems to be quite slow. I am aware of using a fileoffset as an option to optimise, but beyond that, are there any ways in which I can better improve predicates as been below?

    SELECT           event_data         ,n.value('@timestamp', 'DATETIME2') DtTimeStamp         ,n.value('(action[@name="collect_cpu_cycle_time"]/value)[1]', 'bigINT') CollectCpuCycleTime         ,n.value('(action[@name="collect_system_time"]/value)[1]', 'DATETIME2') CollectSystemTime         ,n.value('(action[@name="last_error"]/value)[1]', 'varchar(255)') LastError         ,n.value('(action[@name="collect_system_time"]/value)[1]', 'datetime2')             CollectSystemTime         ,n.value('(action[@name="task_time"]/value)[1]', 'bigint')                          TaskTime         ,n.value('(action[@name="client_app_name"]/value)[1]', 'varchar(255)')              ClientAppName         ,n.value('(action[@name="client_hostname"]/value)[1]', 'varchar(255)')              ClientHostName         ,n.value('(action[@name="database_name"]/value)[1]', 'varchar(255)')                DatabaseName         ,n.value('(action[@name="nt_username"]/value)[1]', 'varchar(255)')                  NtUserName         ,n.value('(action[@name="server_instance_name"]/value)[1]', 'varchar(255)')         InstanceName         ,n.value('(action[@name="session_id"]/value)[1]', 'INT')                            SessionID         ,n.value('(action[@name="client_pid"]/value)[1]', 'INT')                            ClientPID         ,n.value('(action[@name="sql_text"]/value)[1]', 'VARCHAR(MAX)')                         SQLText     FROM          (             SELECT                  CAST(event_data as XML) event_data             FROM                  sys.fn_xe_file_target_read_file('C:\Temp\EE_QueryWarnings*.xel', null, null, null)         ) ed     OUTER APPLY         ed.event_data.nodes('event') (n)     WHERE         n.value('@name', 'varchar(MAX)')    = 'missing_column_statistics'     AND         n.value('@timestamp', 'DATETIME2')   >= DATEADD(MINUTE,-10,GETUTCDATE()); 

Counting the number of binary strings of length m with no consecutive 1s (RR). How to improve it?

I am new to Mathematica and I am trying to solve this problem of counting the number of binary strings of a certain length m, as far as no consecutive 1s are there.

For instance m = 3, my recurrence relation should give 5 i.e. 000, 001, 101, 100, 010.

I started like this with initial seeds: n > 0; a[ 1] = 1, a[2] = 3, a[3] = 5 and then in RSolve I did:

enter image description here

Is there a better way to improve it so that I can use the output in a plot? Currently, I cannot as my solution says it cannot be used as function.

Thanks.

Why do I take a lot of time to implement sth by myself.How can I improve on that

I have been working as a developer for 2 years now. I have no problem writing logic and doing programming. I have fairly good understanding of data structures .I participate in hacker rank,leet code etc without much difficulty.But when it comes to implementing sth alone, I spent a lot of time face lot of questions and confusions.

For example , I was trying to download files from google drive programmatically in python. When I started reading the documentation of google drive API, I couldnt make sense of everything I read quickly. I have to keep searching ,going back and forth, read the same sentence mutiple times etc.Why does this problem arise? What do I lack? Does it have anything to do with theory related to CS or is it sth everyone face? How can I improve?

How to improve upon being a Warforged Psionic Monk [duplicate]

Thank you, for all of your input. My question is, I’m building a 3.5 Warforged Juggernaut, Psionic Monk. I want to make it permanently large, so I went with this method.

Arachnid Chassis (dragon mag #150)

Scorpion Brand (dragon mag #341)

Iron Toothed Girdle (dragon mag #341)

Muag, component Stone Spitter Box (feign follio)

Jaws of Death (races of ebbron)

Battlefist (ebbron campaign setting)

Does the addition of these components like the Arachnid Chassis and the Scorpion Brand increases his size permanently to large?

After taking 2-3 levels of Monk what would be the optimal level of taking either Psionic Warrior or Ardent to improve my Monk ability thru taking Tashalatora?

The character shall be built to epic levels and fully fleshed out in his other classes of Occult Slayer and Warforged Juggernaut. Do you think they synergize?

How many additional levels of Barbarian should I take to get the best out of the class as well as potentially trade in fast movement for lion totem barbarian?

Lastly, on the barbarian tip. How many levels of Frenzied Berserker should I add for the Berserker Goody’s?

Would you suggest putting Mummy Wraps on the Arachnid leg attack and the battlefist for an extra umph on its attacks, since it is immune to the effects itself?

Almost forgot, would the components be considered natural weapons since they are embedded? So that I could use them all?

Does the character need any levels of fighter for the feat tree?

Would it be better served by either using the Scorpion Brand by itself with it’s some what weak saves or using a Muag Stone Box in it’s place? So (three) boxes, two on it’s shoulders and one potentially on its tail for better effect, especially if the boxes have weapons enhancements on them?

This character has a Warforged Scout riding on his back inside of a Deep Crystal casing. His duties are to keep them going each day, i.e., fixtures, weapon upgrades, enhancements, battle help. So on and so forth.

A little more on the companion he’s an Psionic Artificer he’s constructed of the Psiforged body feat out of the book Magic of Ebbron. I particularly choose him because of his mental dominance over it’s subject. So that when he’s on a Berserker rage he could somewhat control it.

The character is a brawler using it’s full use of different charges and pins full attacks to accomplish it’s mission at hand.

Which enhancements defensively and offensively would be best used?

The character will be used for an DND 3.5 open game.

How to improve performance for read only innodb MySQL Database

I have a particular task which is to maximize the concurrent performance. There is only one particular type of query, which is

select * from table where col1 between ? and ? and col2 between ? and ? 

I have created a composite index for (col1, col2). The table is about 20G in size and 100 million rows

However, even in peak concurrent requests, the CPU utilization for MySQL is only 30%. I have tried various techniques like increase max_connections, innodb_buffer_pool_instances but none of them are working.

How to maximize the configuration so that it can perform such read-only query to extreme?

How Best to Improve Concentration Saves (or avoid the check all together)? [closed]

As I see it there are the following options:

Character Build:

  • Take a level of a class with Con save proficiency at first level.
  • Ability Increase (Con).
  • Diamond Soul – (14th level Monk – not really viable)
  • Aura of Protection – (+Paladin’s Charisma bonus, Also affects nearby allies)
  • Tides of Chaos – (Advantage, Wild Magic Sorcerer ability, self only)
  • Bend Luck – (+1d4, Wild Magic Sorcerer ability used on another)
  • Dark One’s Own Luck – (+1d10, Fiend Pact Warlock, self only)
  • Portent – (Replace a bad roll, Diviner ability)
  • Transmuter’s Stone – (Proficiency, Transmuter ability, but you have to give up other powers)
  • Inspiration – (You must have Inspiration, game mechanic)
  • Lucky – (Reroll bad rolls, feat)
  • Lucky – (Reroll bad rolls, 1/2ling ability)
  • Resilient – (Proficiency, feat)
  • War Caster – (Advantage, feat)
  • Focused Conjuration – (Can’t be broken, Conjuration spells only, Conjurer ability)
  • Bardic Inspiration – (+1dx, Bard ability, thanks BlueMoon93)

Spells:

  • Bless – (1d4 added to save, requires concentration… so defeats the purpose unless you can use it on more than one player.)
  • Foresight – (advantage w/o concentration, but this is a 9th level spell)
  • Gaseous Form – (advantage, requires concentration, can’t cast spells – this is for skedaddlin’)
  • Holy Aura – (advantage, requires concentration – 8th level spell, and super costly)
  • Shapechange – (Change into a creature with proficiency and even advantage with Con Saving throws – 9th level spell)

Magic Items & Boons:

  • Belt Of Dwarvenkind, MANUAL OF BODILY HEALTH, Ioun Stone of Fortitude, Blessing of Health – (Increase Con by 2)
  • Amulet of Health – (Con is set to 19)
  • Holy Avenger, CANDLE OF INVOCATION – (Advantage – while in effect)
  • Cloak of Protection, Luck Blade (also reroll), Stone of Good Luck, Ring of Protection, Robe of Stars, Rod of Alertness – (+1 bonus)
  • Staff of Power – (+2 bonus)

Other Options

  • Don’t get hit! – High AC, or non concentration spells that mess with getting hit (mage armor, mirror image, feats to wear armor, levels of Cleric/Fighter), Up your Dex
  • Use Cover – Thanks BlueMoon93 & nitsua60
  • Don’t be seen – Invisibility, Illusions, get stealth skills.
  • Get out of combat – Mist Step, Dimension Door
  • Go Prone against Ranged attacks – thanks BlueMoon93 & nitsua60
  • Warding Flare (Light Domain Cleric)
  • Defensive Duelist feat (finesse weapon required)

Controversial or Edge Cases

  • Temp hit points
  • Make potions for spells that require concentration.

Are there other options that I have missed?

There are not a lot of ways to get to the concentration saving throw buffed. Which is to be expected in 5e, but I am tired of losing a spell first or second round, so I am trying to build up a list of tactics / ideas on how best to hold onto that 5th level spell I just cast.

What spells, items, and abilities improve wisdom ability checks?

My level 3 cleric is trying to cast a level 5 spell-scroll, and to optimize the chances of success, I want to stack as many positive ability check buffs on him as possible. Preferrably lower-level/easy to access ones. So far I have:

  • Enhance Ability (Wisdom)
  • Bardic Inspiration
  • Guidance
  • Portent (Divination Wizard)

I’m sure I’m missing a ton.