MySQL and memory usage

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
neal121
New to forums
New to forums
Posts: 5
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Apr 16, 2010 5:19 am

MySQL and memory usage

Post by neal121 »

So support told me to come ask this here so I am...

I have the 1 core 1gb memory virtual server package. I currently run a tf2 and l4d2 server. MySQL is taking up about 250mb (maybe more) of memory. How can I tweak this down? All mySQL is used for is tcadmin I think which isn't much at all.
User avatar
Edge100x
Founder
Founder
Posts: 13127
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: MySQL and memory usage

Post by Edge100x »

MySQL has a bunch of options for setting buffer and cache sizes that you can use to drop its memory usage to extremely low levels. On Gentoo, you'd edit /etc/conf.d/mysql/my.cnf and look for the [mysqld] section, which is where the key_buffer, myisam_sort_buffer_size, query_cache_size, and so on can be adjusted. I am not sure where this file is put on a Windows install, but an analog should exist there.

It sounds like your version has high defaults for some of these variables. This site indicates that it can even be adjusted to use <10 MB: http://www.lowendbox.com/blog/reducing- ... end-boxes/
neal121
New to forums
New to forums
Posts: 5
Joined: Fri Apr 16, 2010 5:19 am

Re: MySQL and memory usage

Post by neal121 »

That one said to replace the my.cnf with my-small.cnf.

I know where the my.ini and my-small.ini are so what exactly should I do? Change file names? replace files?
User avatar
Edge100x
Founder
Founder
Posts: 13127
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: MySQL and memory usage

Post by Edge100x »

If you have my.ini and my-small.ini, renaming my.ini to my-big.ini and my-small.ini to my.ini, then restarting MySQL, would likely work.
neal121
New to forums
New to forums
Posts: 5
Joined: Fri Apr 16, 2010 5:19 am

Re: MySQL and memory usage

Post by neal121 »

Well that REALLY messed up TCadmin:

Code: Select all

Connection must be opened. SQL Command: SELECT USER_ID, FIRST_NAME, LAST_NAME, PASSWORD, TYPE, ADDRESS1, ADDRESS2, ADDRESS3, CITY, STATE, COUNTRY, ZIP, HOME_PHONE, MOBILE_PHONE, EMAIL1, EMAIL2, STATUS, PARENT_ACCOUNT, EXTERNAL_ID, BILLING_ID, BILLING_STATUS, GROUP_ID, FILE_SERVER_ACCOUNT, ALLOWED_IPS, SUBUSER_ACCESS_SUPPORT, FILE_SERVER_CUSTOM_GAMES, MD5_PASSWORD FROM TC_USERS WHERE USER_ID = 'admin'
Next suggestion?
User avatar
Edge100x
Founder
Founder
Posts: 13127
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: MySQL and memory usage

Post by Edge100x »

Did MySQL actually start successfully?

You might try undoing the renames and just going back to what I suggested originally (adjusting the various variables downward).
neal121
New to forums
New to forums
Posts: 5
Joined: Fri Apr 16, 2010 5:19 am

Re: MySQL and memory usage

Post by neal121 »

Ill toy around with downsizing.
Post Reply