XFileSharing Pro - Apache httpd.conf and my.cf help

Message
Author
r2b2
Posts: 7
Joined: Nov 01, 2012 3:39 am

Apache httpd.conf and my.cf help

#1 Postby r2b2 » Nov 01, 2012 11:01 pm

Hello

Recently my server started to act weird and is getting too much server load and the ram is used only 30 to 40 percent max below are my configurations hope someone with more knowledge can help me to optimize the server. I've searched the forum and followed some suggestion that have posted PowerChaos but i think it need to be tweaked some values, right now the file server is on the same machine with the script but in a few days i'll transfer it on a separate server and the file server will be with nginx mode

Server configuration is
Intel(R) Core(TM) i7 CPU 950 @ 3.07GHz (8 processors)
24GB Ram
1TB Hard Disk

here is the httpd.conf

Code: Select all

Timeout 30
TraceEnable Off
ServerSignature Off
ServerTokens ProductOnly
FileETag None
StartServers 5
<IfModule prefork.c>
MinSpareServers 5
MaxSpareServers 10
</IfModule>
ServerLimit 500
MaxClients 350
MaxRequestsPerChild 5000
KeepAlive Off
KeepAliveTimeout 10
MaxKeepAliveRequests 5


here is the my.cf

Code: Select all

#DO NOT MODIFY THE FOLLOWING COMMENTED LINES!

#els-build=5.0
[mysqld]
bind-address            = 127.0.0.1
slow-query-log          = 1
slow_query_log_file     = /var/log/mysql.slow-queries.log
open-files-limit        = 32000

local-infile=0
datadir=/var/lib/mysql
skip-locking
#skip-innodb
#skip-networking
safe-show-database
query_cache_limit=4M
query_cache_size=256M ## 32MB for every 1GB of RAM
query_cache_type=1
max_user_connections=350
max_connections=750
interactive_timeout=45
wait_timeout=30
connect_timeout=15
thread_cache_size=256
key_buffer=320M ## 128MB for every 1GB of RAM
join_buffer=6M
max_connect_errors=10
max_allowed_packet=6M
table_cache=2048
record_buffer=4M
sort_buffer_size=4M ## 1MB for every 1GB of RAM
read_buffer_size=4M ## 1MB for every 1GB of RAM
read_rnd_buffer_size=4M  ## 1MB for every 1GB of RAM
thread_concurrency=2 ## Number of CPUs x 2
myisam_sort_buffer_size=4M
server-id=1
collation-server=latin1_general_ci
join_buffer_size=6M
tmp_table_size=100M

max_heap_table_size=80M

#log_slow_queries=/var/log/mysql-slow.log
long_query_time=10
#log-queries-not-using-indexes

[mysql.server]
user=mysql

[safe_mysqld]
#err-log=/var/log/mysqld.log
#pid-file=/var/lib/mysql/mysql.pid
#open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
#no-auto-rehash
#safe-updates

#[isamchk]
#key_buffer=64M
#sort_buffer=64M
#read_buffer=16M
#write_buffer=16M

[myisamchk]
#key_buffer=64M
#sort_buffer=64M
#read_buffer=16M
#write_buffer=16M

#[mysqlhotcopy]
#interactive-timeout

afdah
Posts: 147
Joined: Jan 27, 2012 2:23 pm

#2 Postby afdah » Nov 01, 2012 11:19 pm

post your atop screenshot

search forum for more info about atop

r2b2
Posts: 7
Joined: Nov 01, 2012 3:39 am

#3 Postby r2b2 » Nov 02, 2012 12:37 am

afdah wrote:post your atop screenshot

search forum for more info about atop


here it is screenshot mate

[img]
http://i47.tinypic.com/2gsjs55.png
[/img]

stamos
Posts: 139
Joined: Nov 11, 2010 5:37 pm

#4 Postby stamos » Nov 02, 2012 12:51 pm

increase those:

MinSpareServers 5
MaxSpareServers 10
ServerLimit 500
MaxClients 350

to

MinSpareServers 5
MaxSpareServers 20
ServerLimit 2000
MaxClients 2000

and see what happens

and yes, fileserver should be always seperate

r2b2
Posts: 7
Joined: Nov 01, 2012 3:39 am

#5 Postby r2b2 » Nov 02, 2012 7:30 pm

According to top -c command mysql is the problem
here is the sceenshot of the top -c

Image

So i think the problem is at the my.cnf configuration, i've posted the my.cnf also so any suggestion for that configuration?

stamos wrote:increase those:

MinSpareServers 5
MaxSpareServers 10
ServerLimit 500
MaxClients 350

to

MinSpareServers 5
MaxSpareServers 20
ServerLimit 2000
MaxClients 2000

and see what happens

and yes, fileserver should be always seperate

stamos
Posts: 139
Joined: Nov 11, 2010 5:37 pm

#6 Postby stamos » Nov 02, 2012 7:38 pm

you have nginx and apache running?!

stamos
Posts: 139
Joined: Nov 11, 2010 5:37 pm

#7 Postby stamos » Nov 02, 2012 7:43 pm

sorry I mistakenly pressed submit...

your temp cache table is too small, with this memory se it to
tmp_table_size = 1024M
also increase key buffer
key_buffer = 1024M

why are you loggins slow queries?
if not need it, disable it.
query_cache_size is tto big, you don't need it.

in general, run this script, it will help you optimizing your mysql:

MySQL Performance Tuning Primer Script
http://www.day32.com/MySQL/

r2b2
Posts: 7
Joined: Nov 01, 2012 3:39 am

#8 Postby r2b2 » Nov 02, 2012 7:47 pm

Yes it is installed from http://nginxcp.com and it works with combination with apache

afdah
Posts: 147
Joined: Jan 27, 2012 2:23 pm

#9 Postby afdah » Nov 02, 2012 10:21 pm

Yes it is installed from http://nginxcp.com and it works with combination with apache


try uploading a file and you will find that the upload progress meter does not work.

r2b2
Posts: 7
Joined: Nov 01, 2012 3:39 am

#10 Postby r2b2 » Nov 06, 2012 4:22 am

afdah the upload progress meter is working it just need to specify the port where apache is running in the file server configuration inside the admin panel

afdah
Posts: 147
Joined: Jan 27, 2012 2:23 pm

#11 Postby afdah » Nov 06, 2012 5:52 am

i don't see any advantage using nginx this way.
get a real nginx mod and you will see real improvement of your load.
seperate main and file server.

banimp3
Posts: 24
Joined: Dec 06, 2009 5:23 pm

#12 Postby banimp3 » Nov 06, 2012 6:42 pm

r2b2,


1)It appears that your issue is related to I/O of Hard Disk.

top shows that your CPU is not overloaded and you have enough free ram.

you can install and rum "iotop" to see your I/O live usage.


Run:

hdparam -I /dev/sda (if your Disk device is sda)

Look for your hard drive model/make and check if it's a slow disk (5,400RPM).


2) You should avoid using i3, i5, i7 servers. They have been build for home workstations NOT for servers.


You can send me a PM if you need more help.

banimp3
Posts: 24
Joined: Dec 06, 2009 5:23 pm

#13 Postby banimp3 » Nov 06, 2012 6:44 pm

Regarding your webserver tweak.

Try with this one:


StartServers 5
MinSpareServers 5
MaxSpareServers 10
ServerLimit 200
MaxClients 150
MaxRequestsPerChild 300

r2b2
Posts: 7
Joined: Nov 01, 2012 3:39 am

#14 Postby r2b2 » Nov 06, 2012 6:51 pm

banimp3 i've tried to send you a pm but they are disabled so if you have a skype could you add me if you have some free time to help me my skype is: slavco.s

banimp3
Posts: 24
Joined: Dec 06, 2009 5:23 pm

#15 Postby banimp3 » Nov 06, 2012 6:53 pm

Give me your skype ID


Return to “XFileSharing Pro”