Optimizing my Slice

Apache


http://forum.slicehost.com/comments.php?DiscussionID=1082&page=1#Item_9

Which is basically this:

  1. StartServers 3
  2. MinSpareServers 3
  3. MaxSpareServers 3
  4. ServerLimit 50
  5. MaxClients 50
  6. MaxRequestsPerChild 1000

This seemed to work for a while but then things got sluggish so I added my.cnf to /etc/ based on this article.

  1. [mysqld]
  2. port = 3306
  3. socket = /var/lib/mysql/mysql.sock
  4. skip-locking
  5. key_buffer = 16K
  6. max_allowed_packet = 1M
  7. table_cache = 4
  8. sort_buffer_size = 64K
  9. read_buffer_size = 256K
  10. read_rnd_buffer_size = 256K
  11. net_buffer_length = 2K
  12. thread_stack = 64K
  13.  
  14. # For low memory, Berkeley DB should not be used so keep skip-bdb uncommented unless required
  15. skip-bdb
  16.  
  17. # For low memory, InnoDB should not be used so keep skip-innodb uncommented unless required
  18. skip-innodb
  19.  
  20. # Uncomment the following if you are using InnoDB tables
  21. #innodb_data_home_dir = /var/lib/mysql/
  22. #innodb_data_file_path = ibdata1:10M:autoextend
  23. #innodb_log_group_home_dir = /var/lib/mysql/
  24. #innodb_log_arch_dir = /var/lib/mysql/
  25. # You can set .._buffer_pool_size up to 50 - 80 %
  26. # of RAM but beware of setting memory usage too high
  27. #innodb_buffer_pool_size = 16M
  28. #innodb_additional_mem_pool_size = 2M
  29. # Set .._log_file_size to 25 % of buffer pool size
  30. #innodb_log_file_size = 5M
  31. #innodb_log_buffer_size = 8M
  32. #innodb_flush_log_at_trx_commit = 1
  33. #innodb_lock_wait_timeout = 50
  34.  
  35.  
  36. [mysqldump]
  37. quick
  38. max_allowed_packet = 16M
  39.  
  40. [mysql]
  41. no-auto-rehash
  42. # Remove the next comment character if you are not familiar with SQL
  43. #safe-updates
  44.  
  45. [isamchk]
  46. key_buffer = 8M
  47. sort_buffer_size = 8M
  48.  
  49. [myisamchk]
  50. key_buffer = 8M
  51. sort_buffer_size = 8M
  52.  
  53. [mysqlhotcopy]
  54. interactive-timeout

This seemed to help a bit but apache started to creep up again so I modified /etc/apache2/apache2.cnf again modifying the block above as follows:

  1. <IfModule mpm_prefork_module>
  2. StartServers 1
  3. MinSpareServers 1
  4. MaxSpareServers 5
  5. ServerLimit 50
  6. MaxClients 50
  7. MaxRequestsPerChild 5000
  8. </IfModule>

Restarted apache:

  1. /etc/init.d/apache2 restart

Way Faster!!

apache2 / mysql is still a bit spikey but there is a noticeable difference in the admin (not-cached) of my Drupal 6 install.

Not 5 minutes later apache2 and mysqld are tag teaming against my slice! :(

After adding the following to my.cnf file, the site seemed to respond a bit better. Perhaps it was just the service restart.

  1. query_cache_type=1
  2. query_cache_size=6M
  3. query_cache_limit=1M

Which was found here.

No votes yet