web hosting – a little experience

Before I start with the nonsense, I want to say, that I am not very advanced with web hosting and all I will write is the experience I have gained in recent times 2-3 months. I administer a fairly busy VPS in terms of traffic, according to tyxo is in the top 80 but enters the top 70 ;). That's my thought, that after so long I have acquired various habits and reached good practices in one way or another (usually more difficult) :D. I will not even write or go into the details of the configuration at all. Rather, I will share ideas to think about.

  1. Update the software regularly. Apache, php mysql all wants updates. Whether to patch holes in the security, whether due to fixed bugs or new features. Always keep your software up to date. In general, it is rare to drill a server through the applications, usually through holes in the code of the hosted things, but let's not rely only on this.
  2. Apache – it is not desirable for your web server to have more active modules than the ones you actually use. The more modules on- slow work.
  3. Multiple users on the same server – opcode cache. Some time ago I wrote Besides zerdion do satisfactory tests and see the real benefits of this magic. In my case I chose eAccelerator because in a real working environment it shows the best results with all the settings to it. Faster loading with less eating resources, which means more users.
  4. They push you with traffic – gzip. The easiest way to reduce the real traffic you make is with gzip compression of http responses to the client. Mod deflate is the apache solution. For other http servers I have not researched the issue :). Real around 50% I lost traffic when compressing on html,css,js,xml. I need to see if I can compress other types of content as well. Because real photos are the content that makes the most traffic in a site.
  5. mysql serer – I highly recommend it if you haven't been awarded a version 5.1 to do it. In general, Oracle has some small experience with databases 😆 and this experience has put it well into 5.1 version I have not tried 5.5 but I plan to do that soon. Definitely speeded up the work of sql queries maybe slightly dropped the load but by no more than 5-6% but also the new functionalities for the programmers are wonderful. The basic one partitions. When upgrading, be careful what settings you have in my.cfg Not all old options are valid, it's also a good idea to remove old libraries at least with CentOS 5.5 made problems with Debian I did not have such annoyances. Then look at the mysql log because some of the options have different names and it is good to change them if you go to 5.5 don't wonder why your configuration doesn't work.
  6. sql queries. Be sure to enable the slow query recording option. In these logs you can return information to the programmers if you are not for slow requests to be optimized. The fewer such requests the less load on your server 😉
  7. A little protection – change the default port of ssh you don't need crazy bots to try to hack you. Apache secure it with mod_security quite a useful module makes filtering on quite a bit – sql inj, rfi DDoS and others. It won't stop a lot of fuss, but at least the lamers will weed them out. PHP is a good idea to protect with Suhosin. It can be put as an additional extension or directly as a patch in the php code. I personally prefer the first one I think is cleaner.

For starters, these are the things I can think of. They are not many and when I think about it I have done a lot of optimizations on the server but many of them are quite specific according to the situation and there is no point in explaining them such as cache limits or how many processes the apache has been raised. Probably in time I will think of more things that are how to say some of the little things that give the big result.. The machine is quite well optimized for comparison we make 20k unique visits per day and we are on the lowest possible vps plan load time on the pages we do not exceed 1,5-2 sec or if it exceeds it is due to external sources of ads otherwise the page itself spits out for fractions of a second. People close to us have non-optimized servers with a lot more resources than ours and have the same results. In general, his mother is optimizing and her father is drinking beer

ps The song is slightly related to the theme 😀


  1. Don't be modest - the site does 22-23 k daily and the close competition are really at the highest level for vps with your optimization and help we are able to stick to 2-3 k below them on the smallest plan for vps , which for me personally is a huge advantage 🙂 thank you for that.

  2. And I forgot to mention the server is currently holding up 500 user online 🙂 and behaves well, of course this is not its constant load but it withstands them.

Leave a Reply

Your email address will not be published.

Anti SPAM *