Results 1 to 17 of 17
  1. #1
    Join Date
    Feb 2006
    Location
    Kusadasi, Turkey
    Posts
    3,273

    Server has 7 GBs of free RAM

    Current server has 4 GB ram, all buffered by linux.

    Code:
    
                 total       used       free     shared    buffers     cached
    Mem:          4054       3917        137          0         99       2139
    -/+ buffers/cache:       1678       2375
    Swap:         4094          0       4094
    
    The buffer has 2375 MB of free ram. However this is a heavy mysql server. I want the empty ram be used by mysql so it becomes faster.

    We are currently moving to a 8GB ram server, and the free ram will be around 7 GB if we use the exact same configuration. I want the free ram to be 1 GB at most, why pay for 8 GB ram if I'm going to use a fraction of it?

    What optimizations should I attempt?

    Notes:
    - I know about harddisk I/O bottlenecks, I have two SATA drives in the system, and a SAS drive dedicated to mysql, that's all we can afford currently.
    - All mysql databases are for SMF forums, and currently using MyISAM tables. Switching to another storage engine is a possibility, if it won't create problems in restarts and hot backups.
    Fraud Record - Stop Fraud Clients, Report Abusive Customers.
    █ Combine your efforts to fight misbehaving clients.

    HarzemDesign - Highest quality, well designed and carefully coded hosting designs. Not cheap though.
    █ Large and awesome portfolio, just visit and see!

  2. #2
    Join Date
    Apr 2009
    Location
    Kerala, India
    Posts
    19
    You can clear the cached RAM by executing the following command as root

    ========================================
    sync; echo 3 > /proc/sys/vm/drop_caches
    ========================================

  3. #3
    Join Date
    Feb 2006
    Location
    Kusadasi, Turkey
    Posts
    3,273
    Great, but that's not what I'm asking at all Thanks for trying to help though!
    Fraud Record - Stop Fraud Clients, Report Abusive Customers.
    █ Combine your efforts to fight misbehaving clients.

    HarzemDesign - Highest quality, well designed and carefully coded hosting designs. Not cheap though.
    █ Large and awesome portfolio, just visit and see!

  4. #4
    Join Date
    Apr 2009
    Location
    Kerala, India
    Posts
    19
    I'm sorry about that. That was the response to another post, got the tabs mixed up.

    You can use the MySQL Tuner script for doing this

    # wget http://mysqltuner.com/mysqltuner.pl
    # chmod +x mysqltuner.pl
    # ./mysqltuner.pl

    This will let you know which Variables to adjust for optimum performance.

  5. #5
    Join Date
    Feb 2006
    Location
    Kusadasi, Turkey
    Posts
    3,273
    Thanks, we are already using it, but it doesn't show us a way to populate the RAM for the best performance.

    I was hoping to get a few more opinions from a few more people!
    Fraud Record - Stop Fraud Clients, Report Abusive Customers.
    █ Combine your efforts to fight misbehaving clients.

    HarzemDesign - Highest quality, well designed and carefully coded hosting designs. Not cheap though.
    █ Large and awesome portfolio, just visit and see!

  6. #6
    Join Date
    Aug 2002
    Location
    Bharat
    Posts
    4,722
    Have you checked, where all the RAM is being used and how much RAM MySql is using?
    Vinsar.Net - Quality Web Hosting at Economical Price on USA & European Servers
    Offering domains, shared, reseller & VPS hosting.
    Reliable Domain Reseller Account Resell Domains with Confidence

  7. #7
    Join Date
    Feb 2006
    Location
    Kusadasi, Turkey
    Posts
    3,273
    Quote Originally Posted by vinsar View Post
    Have you checked, where all the RAM is being used and how much RAM MySql is using?
    Yes, RAM is staying idle, as I posted in my first post. Not sure particularly how much MySQL is using, but I sure like it to increase, so it gets faster.
    Fraud Record - Stop Fraud Clients, Report Abusive Customers.
    █ Combine your efforts to fight misbehaving clients.

    HarzemDesign - Highest quality, well designed and carefully coded hosting designs. Not cheap though.
    █ Large and awesome portfolio, just visit and see!

  8. #8
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    Are you using the query cache?
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  9. #9
    Join Date
    Feb 2006
    Location
    Kusadasi, Turkey
    Posts
    3,273
    Quote Originally Posted by foobic View Post
    Are you using the query cache?
    Is it an application level or a server-wide setting?
    Fraud Record - Stop Fraud Clients, Report Abusive Customers.
    █ Combine your efforts to fight misbehaving clients.

    HarzemDesign - Highest quality, well designed and carefully coded hosting designs. Not cheap though.
    █ Large and awesome portfolio, just visit and see!

  10. #10
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    Server-wide. http://dev.mysql.com/doc/refman/5.1/en/query-cache.html

    Trying to get it to use all your spare memory would probably be counter-productive, but it's certainly worth giving it something.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  11. #11
    Join Date
    Aug 2002
    Location
    Bharat
    Posts
    4,722
    Your total RAM is 4054, used is 3917 and free is 137 how come the server has 7 GB?

    query cache is a MySql setting that you set in my.cnf

    Is this a cPanel server
    Can you post the /etc/my.cnf content here (remove the client/password section if it is in there)?
    Vinsar.Net - Quality Web Hosting at Economical Price on USA & European Servers
    Offering domains, shared, reseller & VPS hosting.
    Reliable Domain Reseller Account Resell Domains with Confidence

  12. #12
    Join Date
    Apr 2003
    Location
    Los Angeles, CA
    Posts
    800
    You are already using that RAM for caching, so it's not just sitting there unused. The kernel takes care of caching for you on the block and file system level. The only place where you can cache things on mySQL itself is with the query cache, which works pretty well if your data has lots of repeating reads.

    The mySQL tuning primer will tell you if you buffers are sufficiently large (for joins, sorting, etc). but these are used to process a query. Repeated access to the data on the disk itself is cached by the OS, so the more RAM you have for caching the better (you currently use 2.1 GB).

    For comparison, my DB server has 16 GB of RAM, of which over 15 GB are just cached data. It handles about 20 million queries a day without breaking a sweat.
    Pings <1 ms, Unlimited Transfer, Lowest Price: http://localhost/

  13. #13
    Join Date
    Feb 2006
    Location
    Kusadasi, Turkey
    Posts
    3,273
    Quote Originally Posted by vinsar View Post
    Your total RAM is 4054, used is 3917 and free is 137 how come the server has 7 GB?
    As I said in the first post, the new server will have.

    I will try query cache and give it a few GBs of ram to use, and let you know the result, thanks
    Fraud Record - Stop Fraud Clients, Report Abusive Customers.
    █ Combine your efforts to fight misbehaving clients.

    HarzemDesign - Highest quality, well designed and carefully coded hosting designs. Not cheap though.
    █ Large and awesome portfolio, just visit and see!

  14. #14
    Is this a 32bit or 64bit OS?

  15. #15
    Join Date
    Feb 2006
    Location
    Kusadasi, Turkey
    Posts
    3,273
    64 bit OS.
    Fraud Record - Stop Fraud Clients, Report Abusive Customers.
    █ Combine your efforts to fight misbehaving clients.

    HarzemDesign - Highest quality, well designed and carefully coded hosting designs. Not cheap though.
    █ Large and awesome portfolio, just visit and see!

  16. #16
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    Quote Originally Posted by Harzem View Post
    I will try query cache and give it a few GBs of ram to use, and let you know the result, thanks
    Try it by all means but I think (based on the docs) "a few GB" will be way too much. I would be interested to know where the optimum is though.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  17. #17
    Join Date
    Oct 2009
    Posts
    856
    The query cache is horrible unless your tables are almost or completely static. Any insert or update to a table will invalidate all cached queries involving that table. If you need that form of caching, you should look into other technologies like memcached.

    What you do need to set is key_buffer_size (for MyISAM tables) and innodb_buffer_pool_size (for InnoDB tables) if you want your MySQL server to take advantage of a larger memory pool. I usually keep the sum of those to 75% or more of the total memory size for a server, keeping at least one GB for OS and other programs.

Similar Threads

  1. Replies: 11
    Last Post: 08-07-2008, 11:08 PM
  2. Replies: 0
    Last Post: 06-24-2007, 12:17 PM
  3. Replies: 5
    Last Post: 08-01-2006, 12:32 AM
  4. Free DirectAdmin, Free Personal Backup, Free Back Mail server
    By scooterh in forum VPS Hosting Offers
    Replies: 10
    Last Post: 05-05-2006, 11:39 AM
  5. Free DirectAdmin, Free Personal Backup, Free Back Mail server
    By scooterh in forum VPS Hosting Offers
    Replies: 0
    Last Post: 04-24-2006, 09:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •