Howdy, Stranger!

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


What's better for MySQL: RAM, CPU or SSD?
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.

What's better for MySQL: RAM, CPU or SSD?

For an intensive MySQL application, what's a better upgrade for a VPS?

  • More RAM
  • Faster CPU
  • SSD
«1

Comments

  • MaouniqueMaounique Host Rep, Veteran

    RAM first and SSD after.
    It depends how big the db is and how often the same data is accessed.
    For small ones better use ram caching, for bigger ones, get SSD.
    CPU is needed usually if your indexes arent right.

  • I started using Redis for really intensive MySQL applications. Redis is fully memcached so RAM is definitly better.

    Thanked by 1lukesUbuntu
  • If you use big data which its size cannot fit in your total memory, you need SSD to speed up temp writing operations.
    In case you can have bigger RAM than your DB size, you might need to configure your my.cnf configuration for better performance.

  • Just SSD. It will offload RAM (speeds come close) and CPU (iowait)

  • MaouniqueMaounique Host Rep, Veteran

    @c0y said:
    It will offload RAM (speeds come close)

    No way, RAM will do waaaay better, especially with small data packets, the seek time, while greatly improved on SSD over HDD for each operation, has a much longer path on much slower controllers/mediums. In ram it is CPU->cache check->memory controller->memory banks which all run at insane speeds, especially in servers, while a SSD path is much longer on much slower controllers.

  • If MyIsam, use SSD and if innodb use SAS HD. I heard SSD is not good enough for sequential writing

    CMIIW

  • fapvpsfapvps Member
    edited November 2013

    1 SSD
    2 RAM
    3 CPU

  • it's not what is the best but what you will do with your database and how your database is.

    SSD/SAS can be good when data is not in cache but 32Gig of cache if your mostly reading, don't need fast drive.

    Lot of update then go to SSD or SAS 15K

    Many short query good cpu will be need.

    You need balance well based on query type

  • MaouniqueMaounique Host Rep, Veteran

    iconvergence said: You need balance well based on query type

    Yes, different needs for different setups.
    If all things equal, however, you will always get most performance from RAM caching, then from responsive, many IOPS storage. CPU comes last, if you do have high load and it is not iowait, then there is something wrong with the indexes, usually.

    Thanked by 1lukesUbuntu
  • RAM solves everything on a MySQL server. Well almost everything. Binlogs when enabled will fsync. But you can play with the devil and put it on ramdisk so it comes back to RAM :P

  • well i would go for ram in most setup
    however on billing system we ran for voip, that's wasn't the help and need update delay for limit locking, but i agree ram is generally the key for mysql

  • +1 RAM

  • MySQL use Ram to make it good work
    then +1 for ram

  • aglodekaglodek Member
    edited November 2013

    @FrankZ said: +1 RAM

    +1 for RAM, too, but with one important caveat: make sure you tweak my.cnf to use all the RAM you want MySQL to make use of! Default config limits that to 256MB, or something like that, I forget. Suggest using PerconaDB, too (same but better MySQL ;) as long as you know there is no default my.cnf at all and you need to create one from the sample file provided.

  • @aglodek - good point


    Add to my.cnf (edit to your needs)

    qquery_cache_size = 1024000000

    query_cache_type=1

    query_cache_limit=12800000

    Old link still works

    http://www.cyberciti.biz/tips/enable-the-query-cache-in-mysql-to-improve-performance.html

    Thanked by 1aglodek
  • RAM, CPU and SSD 2nd

  • +1 for mariadb just moved to this recently.. great for clusters, anyway here is my 2cents in order of what i go for...

    • mem - for memory tables, sorting and ordering and some join operations.
    • ssd - throughput as its usually the bottleneck for any large database.
    • cpu - speed/cores MySQL takes advantage of many cores, mainly needs them for complex calculations
  • It depends what the MySQL server do. We have some Querries that killing the CPU and need lot's of CPU Performance but the tables aren't big (<6GB). So RAM or SSD don't help here.

    To determine what is important is to check what the Querries do. Only select, update,.. operations than you should go with SSD and RAM. If you do bigger calculations upgrade CPU first.

  • blackblack Member
    edited November 2013

    What do you mean by "intensive"?

    Big DB transactions ( huge blocks of data )? A lot of writes? A lot of reads?

  • I have few joomla sites.. say 25.. it does access MySQL.. in that case RAM shud be more than enough isnt it? Shud we plan for SSD in such scenario?

  • MaouniqueMaounique Host Rep, Veteran

    for hosting ram is usually ok.
    However, just throwing ram at it is not enough. You need to tweak the configs to take advantage of it, if the config limits it to 256 MB it will not use more...

  • jarjar Patron Provider, Top Host, Veteran

    What's better for MySQL: RAM, CPU or SSD?

    Yes.

  • @Maounique said:
    for hosting ram is usually ok.
    However, just throwing ram at it is not enough. You need to tweak the configs to take advantage of it, if the config limits it to 256 MB it will not use more...

    how to make use of RAM most appropriate?

  • MaouniqueMaounique Host Rep, Veteran

    For webhosting something like this should do:
    http://www.joomlaperformance.com/articles/server_related/tweaking_mysql_server_23_16.html

    There are scripts that tell you what to do:
    http://www.solidservers.ca/2009/07/tuning-tweaking-mysql/
    You can also log as root into phpmyadmin and check the status page.

    Thanked by 1lukesUbuntu
  • jarjar Patron Provider, Top Host, Veteran

    @Maounique said:
    For webhosting something like this should do:
    http://www.joomlaperformance.com/articles/server_related/tweaking_mysql_server_23_16.html

    There are scripts that tell you what to do:
    http://www.solidservers.ca/2009/07/tuning-tweaking-mysql/
    You can also log as root into phpmyadmin and check the status page.

    Bookmarked. I need to get better at mysql tuning. I just cache everything to death.

  • MaouniqueMaounique Host Rep, Veteran

    That is just for beginners...
    You may need something more in-depth.

  • Needs RAM and SSD but if you have many concurrent access to database needs Faster CPU too

  • MaouniqueMaounique Host Rep, Veteran

    Why would anyone host huge DB servers with MySQL ?
    While possible, there are better and more scalable choices.

  • In my experience with e-commerce sites, it seems we usually saw that memory, disk io speed, and then cores came into play for our performance. Other shops I have worked with, which are in analytics/advertising, seemed to have much more complex query's and would usually eat much more CPU than the ecom sites(views vs crunching).

Sign In or Register to comment.