Đ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: 6.37, 6.51, 6.48

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:15.78 mysqld

16444 apache 15 0 32540 13m 4476 S 16.4 0.4 0:16.64 httpd

18190 apache 15 0 32728 13m 4408 S 12.5 0.4 0:08.06 httpd

28601 apache 15 0 32556 13m 4528 R 11.8 0.4 1:18.13 httpd

18286 apache 16 0 34584 15m 4400 S 11.5 0.5 0:07.12 httpd

11192 apache 15 0 34008 15m 4884 S 11.2 0.5 0:34.07 httpd

15476 apache 15 0 32548 13m 4396 S 10.8 0.4 0:17.35 httpd

6660 apache 16 0 32548 13m 4408 S 10.2 0.4 0:47.81 httpd

15099 apache 16 0 31640 12m 4340 R 10.2 0.4 0:20.39 httpd

18202 apache 15 0 30676 11m 4348 S 9.8 0.4 0:09.91 httpd

18236 apache 15 0 32648 13m 4324 S 9.8 0.4 0:07.99 httpd

18736 apache 15 0 32660 13m 4332 R 7.9 0.4 0:06.21 httpd

18203 apache 15 0 34096 14m 4416 S 7.2 0.5 0:07.59 httpd

15478 apache 15 0 32540 13m 4520 S 6.6 0.4 0:17.96 httpd

12582 apache 15 0 32508 13m 4544 S 5.9 0.4 0:30.64 httpd

20107 apache 16 0 32432 12m 4332 R 5.9 0.4 0:01.52 httpd

16480 apache 15 0 31964 12m 4364 S 5.6 0.4 0:13.74 httpd

16622 apache 15 0 32252 13m 4392 S 5.6 0.4 0:13.95 httpd

17520 apache 15 0 31492 12m 4380 S 5.6 0.4 0:10.74 httpd

17965 apache 15 0 32540 13m 4380 S 5.2 0.4 0:06.81 httpd

11514 apache 15 0 34064 14m 4436 S 4.3 0.5 0:35.57 httpd

18191 apache 15 0 32384 13m 4360 S 3.6 0.4 0:08.03 httpd

7361 apache 15 0 32520 13m 4468 S 3.3 0.4 0:41.52 httpd

16022 apache 16 0 32368 13m 4472 S 2.6 0.4 0:15.92 httpd

12879 apache 15 0 32432 13m 4500 S 2.3 0.4 0:29.36 httpd

17256 apache 15 0 33988 14m 4400 S 2.3 0.5 0:11.83 httpd

15925 apache 15 0 32520 13m 4380 S 1.3 0.4 0:16.35 httpd

19081 apache 16 0 31964 12m 4368 S 0.3 0.4 0:04.58 httpd

19814 root 15 0 2148 1068 804 R 0.3 0.0 0:00.16 top

1 root 15 0 1744 580 500 S 0.0 0.0 0:01.32 init

2 root RT 0 0 0 0 S 0.0 0.0 0:00.00 migration/0

3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0

4 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0

5 root RT 0 0 0 0 S 0.0 0.0 0:00.02 migration/1

6 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/1

7 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/1

8 root RT 0 0 0 0 S 0.0 0.0 0:01.14 migration/2

9 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/2

10 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/2

11 root RT 0 0 0 0 S 0.0 0.0 0:00.03 migration/3

12 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/3

13 root RT 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/3

14 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/0

15 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/1

16 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/2

17 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 events/3

18 root 13 -5 0 0 0 S 0.0 0.0 0:00.01 khelper

19 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread

30 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 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, id to code, free mysql server, free code online, free code, code top, code online free, code 8 online, code 8, c# code free, top ram, so slow, mysql top 10, migration expert, mysql free, free mysql, wa, sleeping, shr, rt, php command, optimize mysql

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

Mã Dự Án: #1878203