Đang Thực Hiện

132033 Optimize php/mysql code

My site runs on a Dual Xeon server with 3mb ram. When we have between 60 - 100 online users the server is rather slow and laggish. Sometimes the server will crash because of the heavy load. I normally no longer see slow or stalled mysql processes when I run: mysqladmin -u mydb_uname -p processlist however sometimes when there are a lot of people online (like 100) I'll see some queries start to bottleneck. I did fix many erroneous queries, which is why I no longer see stalled queries unless the load is around 100 members. I imagine there are still some queries that could be improved upon, etc.

We had 2gb of ram, I upgraded to 3gb of ram, however the linux command: free -m shows me this:

total used free shared buffers cached

Mem: 3042 2857 184 0 34 608

-/+ buffers/cache: 2214 827

Swap: 2055 0 2055

Here is what I see when I run TOP:

top - 10:54:28 up 1:58, 1 user, load average: [url removed, login to view], [url removed, login to view], [url removed, login to view]

Tasks: 149 total, 6 running, 143 sleeping, 0 stopped, 0 zombie

Cpu(s): 74.1% us, 17.1% sy, 0.0% ni, 8.0% id, 0.7% wa, 0.1% hi, 0.2% si

Mem: 3115168k total, 2942452k used, 172716k free, 35364k buffers

Swap: 2105336k total, 72k used, 2105264k free, 627376k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

2047 mysql 15 0 176m 74m 4496 S 99.9 2.4 133:[url removed, login to view] mysqld

16444 apache 15 0 32540 13m 4476 S 16.4 0.4 0:[url removed, login to view] httpd

18190 apache 15 0 32728 13m 4408 S 12.5 0.4 0:[url removed, login to view] httpd

28601 apache 15 0 32556 13m 4528 R 11.8 0.4 1:[url removed, login to view] httpd

18286 apache 16 0 34584 15m 4400 S 11.5 0.5 0:[url removed, login to view] httpd

11192 apache 15 0 34008 15m 4884 S 11.2 0.5 0:[url removed, login to view] httpd

15476 apache 15 0 32548 13m 4396 S 10.8 0.4 0:[url removed, login to view] httpd

6660 apache 16 0 32548 13m 4408 S 10.2 0.4 0:[url removed, login to view] httpd

15099 apache 16 0 31640 12m 4340 R 10.2 0.4 0:[url removed, login to view] httpd

18202 apache 15 0 30676 11m 4348 S 9.8 0.4 0:[url removed, login to view] httpd

18236 apache 15 0 32648 13m 4324 S 9.8 0.4 0:[url removed, login to view] httpd

18736 apache 15 0 32660 13m 4332 R 7.9 0.4 0:[url removed, login to view] httpd

18203 apache 15 0 34096 14m 4416 S 7.2 0.5 0:[url removed, login to view] httpd

15478 apache 15 0 32540 13m 4520 S 6.6 0.4 0:[url removed, login to view] httpd

12582 apache 15 0 32508 13m 4544 S 5.9 0.4 0:[url removed, login to view] httpd

20107 apache 16 0 32432 12m 4332 R 5.9 0.4 0:[url removed, login to view] httpd

16480 apache 15 0 31964 12m 4364 S 5.6 0.4 0:[url removed, login to view] httpd

16622 apache 15 0 32252 13m 4392 S 5.6 0.4 0:[url removed, login to view] httpd

17520 apache 15 0 31492 12m 4380 S 5.6 0.4 0:[url removed, login to view] httpd

17965 apache 15 0 32540 13m 4380 S 5.2 0.4 0:[url removed, login to view] httpd

11514 apache 15 0 34064 14m 4436 S 4.3 0.5 0:[url removed, login to view] httpd

18191 apache 15 0 32384 13m 4360 S 3.6 0.4 0:[url removed, login to view] httpd

7361 apache 15 0 32520 13m 4468 S 3.3 0.4 0:[url removed, login to view] httpd

16022 apache 16 0 32368 13m 4472 S 2.6 0.4 0:[url removed, login to view] httpd

12879 apache 15 0 32432 13m 4500 S 2.3 0.4 0:[url removed, login to view] httpd

17256 apache 15 0 33988 14m 4400 S 2.3 0.5 0:[url removed, login to view] httpd

15925 apache 15 0 32520 13m 4380 S 1.3 0.4 0:[url removed, login to view] httpd

19081 apache 16 0 31964 12m 4368 S 0.3 0.4 0:[url removed, login to view] httpd

19814 root 15 0 2148 1068 804 R 0.3 0.0 0:[url removed, login to view] top

1 root 15 0 1744 580 500 S 0.0 0.0 0:[url removed, login to view] init

2 root RT 0 0 0 0 S 0.0 0.0 0:[url removed, login to view] migration/0

3 root 34 19 0 0 0 S 0.0 0.0 0:[url removed, login to view] ksoftirqd/0

4 root RT 0 0 0 0 S 0.0 0.0 0:[url removed, login to view] watchdog/0

5 root RT 0 0 0 0 S 0.0 0.0 0:[url removed, login to view] migration/1

6 root 34 19 0 0 0 S 0.0 0.0 0:[url removed, login to view] ksoftirqd/1

7 root RT 0 0 0 0 S 0.0 0.0 0:[url removed, login to view] watchdog/1

8 root RT 0 0 0 0 S 0.0 0.0 0:[url removed, login to view] migration/2

9 root 34 19 0 0 0 S 0.0 0.0 0:[url removed, login to view] ksoftirqd/2

10 root RT 0 0 0 0 S 0.0 0.0 0:[url removed, login to view] watchdog/2

11 root RT 0 0 0 0 S 0.0 0.0 0:[url removed, login to view] migration/3

12 root 34 19 0 0 0 S 0.0 0.0 0:[url removed, login to view] ksoftirqd/3

13 root RT 0 0 0 0 S 0.0 0.0 0:[url removed, login to view] watchdog/3

14 root 10 -5 0 0 0 S 0.0 0.0 0:[url removed, login to view] events/0

15 root 10 -5 0 0 0 S 0.0 0.0 0:[url removed, login to view] events/1

16 root 10 -5 0 0 0 S 0.0 0.0 0:[url removed, login to view] events/2

17 root 10 -5 0 0 0 S 0.0 0.0 0:[url removed, login to view] events/3

18 root 13 -5 0 0 0 S 0.0 0.0 0:[url removed, login to view] khelper

19 root 10 -5 0 0 0 S 0.0 0.0 0:[url removed, login to view] kthread

30 root 10 -5 0 0 0 S 0.0 0.0 0:[url removed, login to view] kblockd/0

I would like for an expert to further investigate and repair the problem(s) with my web site being so slow with so few users online.

Kỹ năng: Bất kì công việc gì, MySQL, PHP

Xem thêm: web code expert, run code online, repair people, php free code, free mysql server, free code online, free code, code top, code online free, code 8, top ram, so slow, mysql top, migration expert, mysql free, free mysql, wa, sleeping, shr, rt, php command, optimize mysql, ni, php cpu 100, optimize php code

Về Bên Thuê:
( 20 nhận xét )

Mã Dự Án: #1878203