upgrading RAM in my VPS


I am currently on a 512MB VPS. So far it was fine, mysql service stopped once when I got about 3000 requests. I don’t know what that was but it only happened really once.

Now, someone posted my link to Reddit, and mysql stopped again.
I had about 600 page views on that day from Reddit but had a problem on first 40, most likely much more than that but it wasn’t logged because page didn’t load and analytics didn’t get data. I assume it was burst of concurrent connections, that made mysql fail.

I think that time has come for me to upgrade to 1GB ram, I earn just enough to cover 1GB RAM plan and I expect more traffic, so that is fine.

My question is about Virtualmin / Webmin settings.
When I installed it, setup wizard asked about memory in the system and optimised all the settings for low ram system.
Should I change anything when the system will have RAM upgraded?
Ah, another question, is there a log for memory use?
Am I able to check RAM consumption for processes for one or days ago?
To be sure that MySql didn’t have enough RAM and it failed because of that?


I have had similar issues, 512MB is not enough to run the full stack of software, 1GB is perfect.

I always leave it at the default settings and have never had an issue.

What VPS technology is your host using? If they are using OpenVZ, there is some things you can do to optimize memory usage, Apache is especially bad in OpenVZ.

Note: this only applies to OpenVZ based machines! You can see if you are running an openvz based VPS by checking for a /proc/user_beancounters file, like this “cat /proc/user_beancounters” if you get this “cat: /proc/user_beancounters: No such file or directory” then you are not running OpenVZ, and this does not apply to you.


Out of curiosity, how many users were on your site on the best day?
Have you had Reddit effect or similar?

I have upgraded my VPS to 1GB RAM.
The only thing remaining now is to figure our, where do I find setting in Virtualmin/Webmin to increase RAM allocation for MySQL.

I remember there was a wizzard for Virtualmin where you could allocate memory for small systems -512 ram, medium - 1GB ram and Big systems - more than 2GB ram.

I think there was also a message that you can do this later in some menu, but I went through all the settings and didn’t find it.

Rerun first run wizard
If you’d like to be presented with those config questions again like after the install, you can make that wizard re-appear by editing /etc/webmin/virtual-server/config. Look for the line “wizard_run=1” and change it to “wizard_run=0”.

Not very busy, but apache eats up a ton of memory, if you are wanting to tweak mysql, you should run “mysql tuner”. It will tell you what settings to change in the my.cnf file to make it run better.

I guess I will loose settings I applied before?

I have never actually done it, but it won’t erase any websites/domains/users. It just reruns that initial wizard. Maybe they could code the mysql settings option for the various memory sizes in.

Although you are better off using mysql tuner, it will help you tweak mysql to your specific usage.


Thanks for this tool.
Have ran it, but I don’t have a clue what to do with recommendations.
This is the report:
Variables to adjust:
query_cache_size (>= 8M) (i have entry query_cache_limit = 1M, while entry is similar, its not the same)
tmp_table_size (> 16M) (i don’t have this entry)
max_heap_table_size (> 16M) (I don’t have this entry)
thread_cache_size (start at 4) (i don’t have this entry)
table_cache (> 64) (my entry is: table_cache=64 what would I need to change?)

I checked my.cnf but entries I should have act upon don’t exist there.
Sorry, It’s my first time doing this.

For the ones you don’t have listed, you need to add them, for the ones you already have, just adjust them.

For example you would add these to my.cnf, each on their own line, in the []


Also you might want to look into CloudFlare, it is a caching service, their basic tier is free, I use it with great success on a few sites.

That makes sense :slight_smile:
Is there some kind of special order that I need to look after?
For example, should I add query_cache_size to special part of config like:




They all need to go under the “[mysqld]” section.

Like this:


Disabling symbolic-links is recommended to prevent assorted security risks


After you make changes you need to restart MySQL.

That works.

Out of curiosity, do you use APC PHP cache?