• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Need help tweaking server

Rob

Well-known member
#1
I've recently migrated to xenforo from vbulletin and expected page loads to be quicker under xenforo but that doesnt seem to be the case at the moment, despite me now using a CDN with xenforo.

I would like help tweaking and maximising performance of my server (VPS). I have shell access and can provide any information but thats where I'm stuck - Server config is definitly not my strong point.

Is anyone prepared to help me? What info do you need?

Thank you for your help
 

Adam Howard

Well-known member
#2
If you're using Debian or Ubuntu I can help you very easily.

But before we get started do a ping test to your Dedicated Server or VPS Server. Make sure that its not a host issues that is making your site seem slow. IF things ping well and resolve well.... Let's move on....

First lets see what is using up so much resources.

apt-get install aptitude

aptitude install htop

top (make a screen copy from here)
htop (make a screen copy from here)

This will get me a basic understanding of what processes your using.

I also need to know the basic of your setup... ie.... Ram, cpu, apache version, php version, and mysql version. I would suggest 5.3.10 for php and mysql 5.5 or 5.6
 

Ghan_04

Active member
#3
I can help if you're running either Red Hat or CentOS - those are the distros I usually use. In either case, if you are using Apache, you might want to consider switching to Nginx or Litespeed, both of which generally have better performance.
 

Rob

Well-known member
#5
This is the ping response (using http://www.webwiz.co.uk/domain-tools/ping.htm )

Ping to 176.56.62.15


Ping from; Web Wiz [Poole - United Kingdom] to studentmidwife.net [United Kingdom]



Ping IP Address Response Time
1 176.56.62.15 9 ms
2 176.56.62.15 16 ms
3 176.56.62.15 11 ms
4 176.56.62.15 12 ms

Ping statistics for 176.56.62.15
Packets: Sent 4, Received 4, Lost 0

Aproximate round trip in milli-seconds
Maximum 16ms, Minimum 9ms, Average 12ms​
And from my own machine (UK):-
Pinging [176.56.62.15] with 32 bytes of data:
Reply from 176.56.62.15: bytes=32 time=22ms TTL=55
Reply from 176.56.62.15: bytes=32 time=20ms TTL=55
Reply from 176.56.62.15: bytes=32 time=20ms TTL=55
Reply from 176.56.62.15: bytes=32 time=25ms TTL=55

Ping statistics for 176.56.62.15:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 20ms, Maximum = 25ms, Average = 21ms
 

Ghan_04

Active member
#6
It would be helpful to know the hardware specs on the server as well. Mainly the RAM will be most important here. Also your traffic levels are good to know to get a better idea of what might need to be tweaked and how much room you have to work with.
 

wickedstangs

Well-known member
#7
I can help if you're running either Red Hat or CentOS - those are the distros I usually use. In either case, if you are using Apache, you might want to consider switching to Nginx or Litespeed, both of which generally have better performance.
I would like help too... VPS server
ping.JPG

whm.JPG
 

Rob

Well-known member
#12
Server Specs:-

OS: Cent OS
CPU: GenuineIntel, Intel(R) Xeon(R)CPU E5606 @ 2.13GHz
Memory: 2.0 GB (817.2 MB free)
Apache: 2.2.3
Mysql: 5.0.95
PHP: 5.2.10


Am working on the aptitude info now
 

Adam Howard

Well-known member
#14
RAM 960MB
FEB 2, 2012-MAR 3, 2012
View attachment 27851
Backup and edit mysql server's /etc/my.cnf and place the following mysql server settings in /etc/my.cnf and restart mysql server afterwards. Make sure to restart mysql server everytime you make changes to your my.cnf for the changes to take effect.

If mysql doesn't restart properly after my.cnf changes make sure skip-innodb entry is removed or commented out from below my.cnf

Code:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

[mysqld]
bind-address = 127.0.0.1
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

#skip-name-resolve
#old_passwords
back_log = 50
#skip-innodb
max_connections = 250
key_buffer_size = 32M
myisam_sort_buffer_size = 64M
myisam_max_sort_file_size = 1048M
join_buffer_size = 256K
read_buffer_size = 256K
sort_buffer_size = 256K
table_definition_cache = 8000
table_open_cache = 8000
thread_cache_size = 256
wait_timeout = 90
interactive_timeout = 60
connect_timeout = 10
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
max_seeks_for_key = 1000
group_concat_max_len = 1024
max_length_for_sort_data = 1024
net_buffer_length = 16384
max_connect_errors = 100000
concurrent_insert = 2
read_rnd_buffer_size = 256K
bulk_insert_buffer_size = 8M
query_cache_limit = 512K
query_cache_size = 48M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65536
range_alloc_block_size = 4096
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
default-storage-engine = MyISAM
max_write_lock_count = 8

innodb_open_files = 500
innodb_data_file_path= ibdata1:10M:autoextend
innodb_buffer_pool_size = 256M
innodb_additional_mem_pool_size = 32M

innodb_log_files_in_group = 2
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_thread_concurrency = 8
innodb_flush_method = O_DIRECT

slow_query_log=0
long_query_time=1
slow_query_log_file=/var/lib/mysql/slowq.log

[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = -5
open-files-limit = 8192

[mysqldump]
quick
max_allowed_packet = 64M

[myisamchk]
key_buffer_size = 32M
sort_buffer_size = 1M
read_buffer_size = 1M
write_buffer_size = 1M

[mysqlhotcopy]
interactive-timeout
Try install php5-apc (if it's not already installed with cPanel)


For your config.php

Code:
## Caching

#  http://xenforo.com/community/threads/speed-up-your-board-caching.5699/

#  http://xenforo.com/community/threads/tip-use-apc.6456/

$config['cache']['frontend'] = 'Core';

$config['cache']['frontendOptions'] = array(

                                        'caching'                      => true,

                                        'automatic_serialization'      => true,

                                        'lifetime'                      => 10800,

                                        'cache_id_prefix' => 'xf'

);

$config['cache']['backend'] = 'Apc';
 

Rob

Well-known member
#15
Traffic.... March 4th - April 3rd:-
94,736 people visited this site
220,726 Visits
94,736 Unique Visitors
1,580,382 Pageviews
 

Rob

Well-known member
#16
Oh god.... this is confusing.. Why have you hijacked my thread? Cant you maybe have started you own?


It has plesk running.
 

Adam Howard

Well-known member
#17
Server Specs:-

OS: Cent OS
CPU: GenuineIntel, Intel(R) Xeon(R)CPU E5606 @ 2.13GHz
Memory: 2.0 GB (817.2 MB free)
Apache: 2.2.3
Mysql: 5.0.95
PHP: 5.2.10


Am working on the aptitude info now
Upgrade Apache and PhP (if you have no control panel)

Backup and edit mysql server's /etc/my.cnf and place the following mysql server settings in /etc/my.cnf and restart mysql server afterwards. Make sure to restart mysql server everytime you make changes to your my.cnf for the changes to take effect.

If mysql doesn't restart properly after my.cnf changes make sure skip-innodb entry is removed or commented out from below my.cnf

Code:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

[mysqld]
bind-address = 127.0.0.1
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking

#skip-name-resolve
#old_passwords
back_log = 50
#skip-innodb
max_connections = 250
key_buffer_size = 32M
myisam_sort_buffer_size = 64M
myisam_max_sort_file_size = 2048M
join_buffer_size = 256K
read_buffer_size = 256K
sort_buffer_size = 256K
table_definition_cache = 8000
table_open_cache = 8000
thread_cache_size = 256
wait_timeout = 90
interactive_timeout = 60
connect_timeout = 10
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
max_seeks_for_key = 1000
group_concat_max_len = 1024
max_length_for_sort_data = 1024
net_buffer_length = 16384
max_connect_errors = 100000
concurrent_insert = 2
read_rnd_buffer_size = 256K
bulk_insert_buffer_size = 8M
query_cache_limit = 512K
query_cache_size = 48M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65536
range_alloc_block_size = 4096
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
default-storage-engine = MyISAM
max_write_lock_count = 8

innodb_open_files = 500
innodb_data_file_path= ibdata1:10M:autoextend
innodb_buffer_pool_size = 256M
innodb_additional_mem_pool_size = 32M

innodb_log_files_in_group = 2
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 2
innodb_thread_concurrency = 8
innodb_flush_method = O_DIRECT

slow_query_log=0
long_query_time=1
slow_query_log_file=/var/lib/mysql/slowq.log

[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = -5
open-files-limit = 8192

[mysqldump]
quick
max_allowed_packet = 64M

[myisamchk]
key_buffer_size = 32M
sort_buffer_size = 1M
read_buffer_size = 1M
write_buffer_size = 1M

[mysqlhotcopy]
interactive-timeout
Try install php5-apc (if it's not already installed)

For your config.php

Code:
## Caching

#  http://xenforo.com/community/threads/speed-up-your-board-caching.5699/

#  http://xenforo.com/community/threads/tip-use-apc.6456/

$config['cache']['frontend'] = 'Core';

$config['cache']['frontendOptions'] = array(

                                        'caching'                      => true,

                                        'automatic_serialization'      => true,

                                        'lifetime'                      => 10800,

                                        'cache_id_prefix' => 'xf'

);

$config['cache']['backend'] = 'Apc';
 

craigiri

Well-known member
#20
I got a noticeable speed bump by turning off apache logging. If you use goog analytics, you probably don't need logging on the server. Keep in mind logging has to write a lot of information to a file for every page and image loaded.

Most of the other stuff is a balancing act between apache and mysql. You seem to have too much free RAM - that will get used up if you increase certain of the mysql and apache settings. The idea is to use the RAM...or at least most of it.