Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Cpu vs RAM for Mysql Server.
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Cpu vs RAM for Mysql Server.

For a WP site with lots of posts which is a bottleneck that causes "Error Establishing a Database Connection"?

Comments

  • cazrzcazrz Member
    1. MySQL optimization
    2. For the topic I would consider RAM then storage/IOps
    3. Are you using some kind of a aggregator plugin? Throttle it or better yet trash it.
  • Cache and MySQL optimization.

    But, WordPress wise, the most probable cause is a bad plugin - one egotistic piece of shitware that slows everything.
    Disable all plugins and see if that works.
    Then, enable one by one, spaced by some hours or days and find which one is the culprit.

    I too had a site that was getting too slow and whatever (not WordPress).
    After reading about MySQL optimization and tweaking my.cnf, I didn't needed a new server, I've allocated more resources to MySQL (RAM essentially), and that solved almost every slowness.

    Thanked by 2RedSox styxtrooper
  • cazrzcazrz Member

    And here's another, if your site isn't very dynamic.
    WP static + bunnycdn

  • BharatBBharatB Member, Patron Provider

    @styxtrooper said:
    For a WP site with lots of posts which is a bottleneck that causes "Error Establishing a Database Connection"?

    Make a Galera cluster, scale it when needed. Try https://cloudjiffy.com/ for your Wordpress. I've seen it running smoothly like butter :)

  • @DrCornFlakes I'll look into my.cnf optimization. thanks.
    @cazrz My site has very minimal images and very slim css and js, its mostly query heavy with lots of custom taxonomies and acf fields.
    @BharatB I'll look into galera cluster, but I still have have no idea should the new cluster have high cores or ram.

  • cazrzcazrz Member

    @styxtrooper said:
    @cazrz My site has very minimal images and very slim css and js, its mostly query heavy with lots of custom taxonomies and acf fields.

    Cache + Wp static + bunnycdn

    Or try Redis/Memcached

  • BharatBBharatB Member, Patron Provider

    @styxtrooper said:

    It all depends on the type of operations, just setup monitoring for your app like espego or new relic and see what is being hit most, you'll know what to do.

    Thanked by 1styxtrooper
  • leapswitchleapswitch Patron Provider, Veteran

    Error Establishing a Database Connection would be caused by

    1. Database server down
    2. Tables corrupted
    3. Max User Connections exceeded
    4. Max Connections exceeded

    Have you reviewed and ensured the above is not the case ?

  • It all depends on the type of operations.

    Thanks, I'll have to look into my own use case.

    @leapswitch Database server becomes inaccessible whenever there is a spike of people visiting in a short time. I have to reboot the server. Doesn't happen often, do you know what kindof db does imdb use, mine is similar with details about local movie, episodes, actors, directors an so on with each its own taxonomy and each actor, director having its own bio pages, movie listings, lots of queries you can say.

  • leapswitchleapswitch Patron Provider, Veteran
    edited May 2020

    @styxtrooper said:

    It all depends on the type of operations.

    Thanks, I'll have to look into my own use case.

    @leapswitch Database server becomes inaccessible whenever there is a spike of people visiting in a short time. I have to reboot the server. Doesn't happen often, do you know what kindof db does imdb use, mine is similar with details about local movie, episodes, actors, directors an so on with each its own taxonomy and each actor, director having its own bio pages, movie listings, lots of queries you can say.

    I have PMed you some additional questions. We handle 100,000 concurrent users on our Wordpress clusters regularly. Here is something we handled last week >

    Thanked by 1dosai
  • exception0x876exception0x876 Member, Host Rep, LIR

    If your database fits in RAM, there is a little benefit of adding more RAM. You're better off with adding CPU cores if that turns to be a limitation.

    However, with WP websites you should just use caching so your requests won't even hit the database.

  • Optimize your code.

  • raindog308raindog308 Administrator, Veteran

    BharatB said: Make a Galera cluster, scale it when needed

    That's a pretty big jump.

    exception0x876 said: If your database fits in RAM, there is a little benefit of adding more RAM.

    True, but that's a big if. How many people's DBs fit in memory? I suppose it might for a small WP site it might. And your statement is not strictly true because the DB uses additional memory for sorts, etc.

    kenhsongao said: Optimize your code.

    Probably not his code if he's running WP.

    styxtrooper said: which is a bottleneck

    Have you run mysqltuner.pl? That's both a script and a URL.

    Thanked by 2styxtrooper Jord
  • Have you run mysqltuner.pl? That's both a script and a URL.

    I have not. I'll look up how to use it. Does it run on the background to catch queries?

  • donkodonko Member
    edited May 2020

    CPU + MySQL Table Indexes.
    I had a problem like you with a Wordpress site having lot of post and only doing indexes on some tables solved my problem, i was wasting a lot of $$$ paying for servers and now i use only a CPX 4gb hetzner.

    This is my server before doing it, i was using redis to cache everything but if i run a purge everything goes down for like 1 hour with 99% cpu usage x_x

    Thanked by 1styxtrooper
  • imokimok Member

    Always check for /wp-admin/admin-ajax.php calls (in browser developer tools). Some plugins will try to store stats or something not needed with every page visit, overloading the server.

  • raindog308raindog308 Administrator, Veteran

    styxtrooper said: Does it run on the background to catch queries?

    No, it's an instance tuner - it tunes your configuration.

  • I've been having issues all year with high traffic crashing my site. I have CPU: 2xXeon E5-2620 v3,
    RAM: 32 GB, 250GB SSD dedicated server which I upgraded to about 2 months ago.

  • @davidjablonski said:
    I've been having issues all year with high traffic crashing my site. I have CPU: 2xXeon E5-2620 v3,
    RAM: 32 GB, 250GB SSD dedicated server which I upgraded to about 2 months ago.

    How much traffic?
    Text/image pages, video, applications/services...?
    Custom made, "click-to-install" script (as WordPress)...?

Sign In or Register to comment.