News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Slow VPS

Started by _Ziggy_, October 15, 2009, 04:03:55 PM

Previous topic - Next topic

_Ziggy_

For a couple of weeks two of my forums are running on a VPS system.
The VPS has Xen, Hypervm and Interworx CP4.0 on board.

I am far from satisfied with the speed of the forums. What can I do to speed them up?
Here is my status.php: http://www.bluesforum.nl/status.php
The performance of the forums was really great on shared hosting, but after moving them to the VPS they slowed down.

I have checked the checklists for performance but I don't think it is right to make adjustments to the forums. They did well with the current settings on shared hosting so I think I have to do something with the VPS.

I am new to VPS so all tips are welcome.
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

H

You forum loaded within a reasonable speed for me.

What mods do you have installed?
Are reverse lookups enabled? (Admin area > Features and Options) If your VPS is taking a long while to do DNS lookups then the whole page will load slowly.

Have you looked at optimising tuning MySQL and Apache? You can find various guides for doing this
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

_Ziggy_

On www.bluesforum.nl/smf I have installed Aeva and the modification to "irritate the lurkers with 0 posts".
Some of the ads are from OpenX (which is a disaster for the past few days), the rest directly from Google Adsense.

On www.bluesforum.com I have installed the Ad Management mod.

Reverse lookups are enabled, I will switch that off.

I haven't looked at MySQL and Apache. I will do that.
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Something like that

You haven't tuned MySQL.

Set key_buffer_size = 64M in /etc/my.cnf and restart MySQL.

H

Aeva has been known to have some performance issues. You might also want to hardcode ads in index.template.php rather than using the ad management mod. It should save some queries
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Joshua Dickerson

Install APC and enable variable caching.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

_Ziggy_

Quote from: Mark Rose on October 16, 2009, 12:11:46 AM
You haven't tuned MySQL.

Set key_buffer_size = 64M in /etc/my.cnf and restart MySQL.

I have added this to my.cnf and this has increased the performance.

On Bluesforum.com I will not reinstall ad management mod after the upgrade to RC2.
On Bluesforum.nl/smf I don't use ad management mod.
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

_Ziggy_

Quote from: groundup on October 16, 2009, 01:53:00 PM
Install APC and enable variable caching.

I have been reading about that, but it is not clear to me how I can install APC.
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Joshua Dickerson

Make sure you read the stickies in this board.

Do a search for "install APC" on this site. You should use a package if you can. It is easier.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

_Ziggy_

I have installed apc, but now my forums stopped running!!!

I have no idea what to do now.

http://www.bluesforum.nl/phpinfo.php
http://www.bluesforum.nl/status.php
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

_Ziggy_

Quote from: Ziggy on October 18, 2009, 01:41:25 PM
I have installed apc, but now my forums stopped running!!!

I have no idea what to do now.

http://www.bluesforum.nl/phpinfo.php
http://www.bluesforum.nl/status.php


I solved this problem myself. I think I am getting better at this  ;) ;) ;)

I have apc installed now, I don't know if the configuration is ok?
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Joshua Dickerson

Did you enable caching in SMF?
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

_Ziggy_

Yes, I did. It is on level 1.

The server is a little bit faster, but it is not what I expected from reading in the topics here.
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Joshua Dickerson

It's more about it's ability to handle load than speed. It will make it slightly faster but significantly more scalable.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

_Ziggy_

Quote from: groundup on October 18, 2009, 03:02:13 PM
...significantly more scalable.

I do not understand what you mean by "more scalable"?
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Joshua Dickerson

Able to handle more users simultaneously.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

_Ziggy_

Ok, thank you.


I want to move this forum: http://www.forum.bluesharp.nl/ to my VPS as well.
Do you expect any problems with the server after moving it to the VPS?
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Aleksi "Lex" Kilpinen

Hi Ziggy, Any updates on this? :)
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

_Ziggy_

The VPS is doing well, but I am still looking for ways to improve it. I don't know if there are more ways to improve the server?

I would like to know if I have enough CPU to add www.bluesharp.nl to the VPS as well, because extra CPU costs twice the price of the shared hosting.
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Joshua Dickerson

Your loads are low and that other forum seems to be slow. I'd say you can easily put that on your VPS.
Come work with me at Promenade Group



Need help? See the wiki. Want to help SMF? See the wiki!

Did you know you can help develop SMF? See us on Github.

How have you bettered the world today?

_Ziggy_

I am having problems when the vps server is updating at night. Sometimes the server crashes during updates and I have to do a reboot.

The VPS runs on Centos 5.4 with Interworx 4 controlpanel.

http://www.bluesforum.nl/status.php
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

rsw686

You should increase your thread_cache_size in my.cnf as well. I have mine set to 10 on my forum with 800 members. Also it isn't ideal to have the server automatically update. You should do these manually to make sure updates that involve config changes don't cause you problems.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

_Ziggy_

I have increased the thread_cache_size to 16.
I changed the key buffer size to 67108864 bytes.

After that I have restarted the mysql server.

What would be a reasonable time to wait after the restart and check the results on http://www.bluesforum.nl/status.php ?
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Aleksi "Lex" Kilpinen

At least a day to see where it is going, for some values a week may be even better.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

_Ziggy_

My table cache is set on 64.
I think it is better to increase it, but I don't know how much?
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Something like that

Quote from: Ziggy on January 07, 2010, 08:27:49 AM
My table cache is set on 64.
I think it is better to increase it, but I don't know how much?

Given that you only have 256M of RAM, I would leave it as it is. Your status shows not a lot of tables opened, so it's not causing any big performance bottleneck in your place. The RAM would be better utilized outside of MySQL for other things.

_Ziggy_

The MySql server is running for 4 days.
I noticed my Swap is about 40%.
http://www.bluesforum.nl/status.php

I have had some problems during server updates and the server crashed.
I think this is caused by MySQL swapping too much.

I am thinking about adding some RAM, but I don't know how much (it is expensive).

I have included some of this weeks graphics.
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Something like that

You could go up to 384.

Here are some changes you could make to my.cnf:
innodb_buffer_pool_size = 1M
key_buffer_size = 48M
skip-bdb                 (add this)

That should free up some RAM.

Swapping will be unavoidable on a 256M machine. Swapping is okay though.

Another thing that can cause issues is a lack of disk space. Clean up things in /tmp, and run su -c 'yum clean packages' to remove cached packages.

_Ziggy_

I did this, but now I am getting this error from php admin:

#2002 - De server reageert niet (or the local MySQL server's socket is not correctly configured)
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Something like that

Try removing the line skip-bdb. Also make sure those other lines aren't duplicated in the [mysqld] section of my.cnf.

_Ziggy_

I put the original my.conf back, but it still doesn't work:


[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
old_passwords=1
max_connections=1000
max_connect_errors=100
connect_timeout=10
wait_timeout=28800
key_buffer_size=67108864
sort_buffer_size=2097144
read_buffer_size=131072
max_allowed_packet=1048576
thread_cache_size=16
table_cache=64
query_cache_limit=1048576
query_cache_size=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Something like that

Remember it's my.cnf not my.conf.

Is that exactly what you had before? What error does mysql show in the error log when you try to start it?

_Ziggy_

The mysql server settings in the Interworx controlpanel where all gone.
I put them back manually and restarted the vps.
The webserver and mysql server are running now.

Some of the other servers haven't started (yet?).
Pop3, secure pop3, IMAP, , Secure IMAP, SMTP, Outbound mail, Alt. inbound mail and DNS server still have to start.
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Something like that

That's likely related to your incomplete upgrade.

_Ziggy_

Everything is running now. http://www.bluesforum.nl/status.php

I have checked the upgrades everyday for the last couple of days. There where no incomplete upgrades. I have also checked just before I did 'yum clean packages'.

I think it has something to do with editing my.cnf outside of Interworx CP.

I have to go to bed, I have to go to work early tomorrow.   :)

Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

_Ziggy_

On january 12 I have added 128mb ram to my VPS. Since then I haven't had any problems with updates.
On january 28 I have moved another forum, 1500 members/36000 posts to my VPS and still no problems.

Now I am running 3 forums on the VPS:
1. 1500 members/ 36000 posts
2. 2000 members/ 73000 posts
3. 176 members/ 500 posts


I have checked http://www.bluesforum.nl/status.php often and typical results are:

Table cache usage: most of the time larger than 0.9, sometimes smaller than 0.5. It is not very often between 0.5 and 0.9.

Thread cache usage: Always smaller than 0.7

Query cache miss rate: Always larger than 0.5

Query cache prune rate: Always larger than 0.05

I think everything is running ok at the moment but I would like to know if I can do any adjustments to have all the figures right.

Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Something like that

You could increase the size of your query cache (try 16M) and your table cache (try 512).

_Ziggy_

In my status file a process called "init" is very busy.

http://www.bluesforum.nl/status.php

I have no idea what it does?

I have had some problems with the server, I am not sure if this is releated to that.
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

青山 素子

init is the root of the application tree. Its PID is 1 for a reason. The init process handles boot and, for System-V compatible systems, runlevel changes.

If init is using a lot of CPU, contact your host as something is likely very wrong.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


_Ziggy_

It uses 13.5% at the moment, is that a lot?

Is this a hardware related problem?
I don't have a service level agreement for the vps so if it is a software problem I have to solve it myself.  :o
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

青山 素子

Not a hardware issue, an OS issue. Did you recently do any updates to the system? The init process should be using 0 CPU.

Old article, but some info on debugging init: Linux-Kernel Archive: Re: init's high CPU usage (2.0.23)
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


_Ziggy_

I have had an automatic update that went wrong.

After the update:
1. The "init" showed up on my http://www.bluesforum.nl/status.php
2. I cannot start ClamAV
3. The memory usage has dropped about 25%
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

_Ziggy_

On # ps aux | less the output is:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  5.4  0.1   2084   652 ?        Ss   Jun04 192:38 init [3]


Does this mean that the runlevel is [3]?  On http://www.bluesforum.nl/status.php it still says "init (1)...  :o

Besides ClamAV everything else on the server seems to be ok.
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

青山 素子

Quote from: Ziggy on June 06, 2010, 09:50:56 AM
**snip**
Does this mean that the runlevel is [3]?  On http://www.bluesforum.nl/status.php it still says "init (1)...  :o

Yes, the number after "init" in the output is the runlevel. The 1 in status.php is the number of processes with that name.

CPU usage still seems a bit high, however. Not sure where to advise you to start as I've not encountered this type of situation before.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


_Ziggy_

Quote from: Motoko-chan on June 04, 2010, 11:43:13 PM
Not a hardware issue, an OS issue. Did you recently do any updates to the system?

This was the update that started the problems:

1.  mysql  5.0.77-4.el5_5.3  os  applied
2.  mysql-devel  5.0.77-4.el5_5.3  os  applied
3.  mysql-server  5.0.77-4.el5_5.3  os  applied

Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

_Ziggy_

My VPS seems to be running now very well.
I have spend a lot of time adjusting the mysql settings.

I don't now what kind of improvements I should do now, so if anyone has suggestions, please let me know.

http://www.bluesforum.nl/status2.php
http://www.bluesforum.nl/apc.php
Bluesforum.com   2.0                     Bluesforum.nl   2.0
Rockabilly-forum.com   2.0              Bluesharp.nl   2.0
Bungalowpark-forum.nl   2.0        Eee pad forum   2.01
Cristiano Ronaldo   2.02              Lockout Tagout   2.02


Looking to buy existing forums, send pm.

Advertisement: