One of my customers had many problems with stability of his server. Service stopped under medium web traffic and the only resolution was server restart. I was asked for optimisation of core components (MySQL database / Apache2 web server) but the result was not very satisfactory. I managed to limit swapping by limitting web server concurrency but it was not real problem solution.
Finally I traced problem source to PHP application run on this server. Joomla (especially forum script) caused system to crawl. One process needed above 60 MB of RSS memory. Imagine system handling 20 concurrent requests. The problems became visible when database size exceeded 200 MB. Source code analysis located the problem: loading big recordsets (whole tables) into memory. One PHP process without memory limit might “swap out” whole server.
My customer decided to rewrite from scratch source code, you will find below results of this optimisation (mostly Munin graphs). New system was installed on 27th March.
Here’s number of slow queries recorded by MySQL, you can see they almost disappeared:
(more…)
Linode.com sells unmanaged VPS servers based on Xen virtualisation technology.
VPS stands for Virtual Private Server and it means one phisycal server is split into smaller parts and every “part” gains his own IP, disk space, CPU and IO resources. You are sharing server resources with other VPS-es, but have much better isolation and customisation than shared hosting supports.
Off-topic note: Besides there’s management panel for Linode you should know Linux/Unix administration very well to make use of “unmanaged VPS”. If you are not advanced administrator better stay with shared hosting or buy “managed VPS”. It will save you many headaches later. VPS (like dedicated server) is not a “piece of cake” for novice webmaster. You’ve been warned.
It’s a review written after one year use of Linode services for one of my customers, Cartalia.com.
(more…)
I believed dedicated server / VPS (Virtual Private Server) always requires dedicated IP adress. Until today.
I found (thanks, LowEndBox) interesting option where you can build your VPS totally custom parameters including shared IP address.How can it work? With shared IP? Youre joking! – you may ask. It works.
TOCICI offers “Nginx Accelerated Shared IP” wchich mean:
- Your VPS will be hidden behind NAT like typical workstation
- External Ngnix HTTP server will redirect HTTP traffic to your box based on URL domain
- You can define custom ports to be forwarded to your box (SSH incoming traffic)
Pros:
- Very cheap option (no cost of dedicated IP required, you can start VPS from 1-2 USD)
- Security (by default no ports visible to external world)
Cons:
- Standard ports except 80 (HTTP) unavailable: no DNS services
- No HTTPS available (requires separate IP)
- SSH login requires custom port (your local network may block high ports to prevent P2P)
The service fills gap between shared hosting and classic VPS. The only problem from my point of view is the distance between Europe and Portland, Oregon in the USA. 220 ms from Warsaw.
It’s very important to know about server problems before they have impart on overall system performance and stability. Typical problem with server that may occur:
- missing disk space
- high server load (caused by CPU/IO)
In past I had problems with web applications failing to operate because lack of free disk space used for session storage. From this time I used to install monitoring on every resource that may be a problem for system.
The easiest way (Keep It Simple Stupid) to be monitored is to redirect email from root@localhost and install checks on root’s crontab. Output written to stdout/stderr (if present) is send to crontab owner after script execution. Our srcipts will only generate output when problem is found. For example:
Notify high (>4) load on server:
*/5 * * * * cat /proc/loadavg | awk '$2 > 4 { print "High 5-minute load", $2 }'
Notify when used disk space is above 90%:
00 21 * * * df | awk '/^\// && $5 > 90 { print $0 }'
Many additional checks could be configured that way.
In addition I used to install munin. It produces graphs that shows various resources levels (day, week, month and year perspective). You can see in one place your overall system. It’s sample graph showing month VPS instance load:

Do you have similar tools to monitor your server performance?
OpenVZ is operating system-level virtualization technology that allows to run multiple virtual machines (with dedicated IP addresses) on one box (with shared filesystem). It’s like a dedicated server but it’s not the one. You have to overcome many limitations:
- Limits on VSZ memory size (virtual, allocated but no necessary used) memory (dedicated servers and Xen have limits on used memory: RSS)
- Fixed kernel with modules (no custom compilations here)
- Limits on inodes allocated etc.
One of important limitations is limit of size of unswapped memory allocated to kernel. In this area resides tcpsndbuf.It’s summary size of buffers that are used to send data. If the value is low your download speed may be limited and sometimes you are getting error:
105 No buffer space available
You can check your limits by executing the following command:
# grep tcpsndbuf /proc/user_beancounters
tcpsndbuf 174336 1735168 1720320 2703360 2801251
Current buffer usage is 174336 bytes, limit is 1720320 bytes and limit was exceeded 2801251 times (ops!). Why send buffer is the problem here instead of receive buffer? Most of the time HTTP server is sending data – requests are much smaller than HTTP responses.
Solutions for this error:
- Limit concurrent connections server handles
- Check if unused connections are closed as soon as possible