I am going to be open, this blog is using the following ingredients:

  • 1 tbsp of nginx
  • 3 cups of wordpress
  • 2 php-fpm
  • 1 serving of linux.
  • 2 portions of mysql

I have built custom templates for websites, I have adapted some and figured out ways of integrating various systems and make them seem “transparent”.

One of the things I have found over a few years, is that one machine without tuning can handle approximately 1000 visits per day and the website may be “slammed” sometimes in a day, there are four big picture things that you can do to maximize the juice of your machine.

Add resources

Having a better machine helps, more CPU, more RAM, SSD drives can help but sometimes a good server configuration means the utilization of those resources, I would add resources as a last resort.

Optimize and Minimize computing

In the case of a Wordpress blog, having too many plugins can cause issues, the main issue, in other backends having non-optimal code or heavy DB queries may affect your performance. (See Time Complexity)

This, is something that we may tackle in a different post.

Load Asyncronously

Sometimes an assembly line is not the best choice for time-performance, for load performance purposes, to have several different little sources of data that can load fast and in parallel on the client side.

Optimize resources and Minimize I/O

Are you squeezing every bit possible out of your machine? Machines these days are very powerful and relatively cheap but it can add up in a situation of heavy load. Therefore it is important to stress test. Here’s a quick checklist while stress testing:

  • Check the amount of unix files you can have open. Depending on your machine you may need something bigger but something along the lines of 64000 will be ok.
1 ulimit -n
  • That you have enough available RAM, if not, make sure your machine is not "swapping"

free -h

  • That your webserver has enough workers to handle the requests. If while stress testing you are getting 500 & 502 errors typically means that the upstream (php-fpm, uwsgi, etc ) connection is saturated.  (Another post on this will follow)
  • Check your logs for clues.
1 tail -f /var/log/syslog
2  tail -f /var/log/nginx/*mysite_error.log
3  tail -f /var/log/php5-fpm.log