I have several websites on a VPS server. I'm using Ubuntu+Apache+PHP+Mysql.
How can I track the performances of each website, and somehow to know when I need to upgrade RAM (I'm progressively adding more and more websites).
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
With a web server, you need to add more RAM when disk swapping starts to negatively impact performance. With a database server, you need to add more RAM when your application profiling suggests that your disk cache isn't big enough to perform well. There's no way to tell from any single measurement taken out of context.
In terms of overall performance monitoring, there's a number of host-level tools that are popular -- Nagios is probably overkill, but Munin or PCP is probably a good fit for your needs. (Note what another poster said about time-based resource monitoring, like CPU usage or disk throughput, being inaccurate from within a VM, however.)
Well memory is fairly straightforward, just use the usual tools (free, vmstat, top or gnome-system-monitor if you fancy). CPU is a different thing as inherently no VM can ever truly self-report on true CPU usage, not without effectly being handed the externally gained stats via whatever vm integration tools your hypervisor of choice provides anyway. If you ask you VPS provider they may well have some form of web or API based mechanism for you to query your VPS stats directly from their own management tools, again depending on what code they're using themselves and whether they choose to offer this.