Optimal php.ini and my.cnf settings for a small Drupal 7 site on a virtual server

I am looking for advice on configuring php.ini and my.cnf by default for a small site (100 pages) with very little traffic (300 visitors per day). All pages have some text, several images, no video, no sound, no flash / silverlight, very little javascript and jquery. For tracking, I use GA and Piwik. The database of the main sites is about 50 MB.

The site is hosted on a virtual server with 20 GB of RAM and 6 vCPU, so I hope it will take a lot of muscle to make it work very quickly.

I don't know much about setting php and mysql settings and would appreciate it if your answers could be as detailed as possible.

thanks

+4
source share
2 answers

You do not need a special setting. Your server is so oversized for a task that really hurts. Any cheap web hosting offer with some PHP and a database would be enough, given that your access numbers are correct.

If you really outgrow in an area where your server shows signs of congestion, your problems will be so special that any general configuration recommendations given today are incorrect.

Just follow the recommended default settings for production servers for PHP 5.4 and MySQL if you do not use software that does not suit them, and is indicated in the documentation.

0
source

I do not think you can configure php.ini and my.cnf so much. You can run mysql tuning primer script: How can I optimize my MySQL server? and https://stackoverflow.com/questions/10820933/ive-run-mysql-tuning-primer-but-i-cant-understand-it but this is hard to understand. I would suggest turning on the slow_query log and exploring slow queries. I also suggest installing nginx or lighttpd and fastcgi (php-cgi) using eaccelerator. It is much faster and easier to set up. There are some interesting lighttpd options. When can you get kvm virtualization to access kernel parameters. I also suggest compiling php yourself and customizing php to your needs. When you use php from the repository, I donโ€™t think you can get each php configure killswitch as a module. Also include HTTP compression and HTTP caching headers. When you have 20 GB, install ramdisk and move the temporary folders to ramdisk.

0
source

Source: https://habr.com/ru/post/1444477/


All Articles