I runnnig Moodle on Lighttpd on Centos 6 with 1G RAM. If I open 10 threads to moodle then moodle starting to be very slow.
How I can to speed the server? I need to serve lot of users.
I checked the memory with free command ande I have lot of free memory.
EDIT: I can to see high CPU of php-cgi.
top:
# top -b -n 1 | head -30
top - 08:55:32 up 24 days, 21:37, 2 users, load average: 0.70, 0.24,
0.08
Tasks: 153 total, 2 running, 151 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.2%us, 0.3%sy, 0.0%ni, 99.4%id, 0.0%wa, 0.0%hi, 0.0%si,
0.1%st
Mem: 1016480k total, 828692k used, 187788k free, 151316k buffers
Swap: 999992k total, 4036k used, 995956k free, 426880k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
29247 lighttpd 20 0 477m 103m 61m R 92.1 10.4 1:37.25 php-cgi
23947 root 20 0 15020 1188 864 R 3.6 0.1 0:00.03 top
1 root 20 0 19228 1040 860 S 0.0 0.1 0:00.61 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
4 root 20 0 0 0 0 S 0.0 0.0 0:05.49 ksoftirqd/0
5 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
6 root RT 0 0 0 0 S 0.0 0.0 0:08.99 watchdog/0
7 root 20 0 0 0 0 S 0.0 0.0 4:35.86 events/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cgroup
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khelper
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 netns
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 async/mgr
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pm
13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 xenwatch
14 root 20 0 0 0 0 S 0.0 0.0 6:02.87 xenbus
15 root 20 0 0 0 0 S 0.0 0.0 0:21.59 sync_supers
16 root 20 0 0 0 0 S 0.0 0.0 0:18.66 bdi-default
17 root 20 0 0 0 0 S 0.0 0.0 0:00.00
kintegrityd/0
18 root 20 0 0 0 0 S 0.0 0.0 0:13.23 kblockd/0
19 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ata/0
20 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ata_aux
21 root 20 0 0 0 0 S 0.0 0.0 0:00.00
ksuspend_usbd
free:
# free -m
total used free shared buffers cached
Mem: 992 809 183 0 147 416
-/+ buffers/cache: 244 748
Swap: 976 3 972
cat /proc/cpuinfo:
processor : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 4
model name : Quad-Core AMD Opteron(tm) Processor 2374 HE
stepping : 2
cpu MHz : 2200.130
cache size : 512 KB
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu de tsc msr pae cx8 cmov pat clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext
3dnow up rep_good unfair_spinlock pni cx16 popcnt hypervisor lahf_lm cmp_legacy extapic cr8_legacy abm sse4a misalignsse
3dnowprefetch
bogomips : 4400.26
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: