PHP Съедает оперативку на VPS. Помогите решить вопрос

12
M8
На сайте с 18.09.2011
Offline
29
2000

Я далек от настроек сервера.

Немного почитав, подключился по ssh, смотрю что показывает top

(На сайте посещаемость смешная, 200 пользователей в сутки)

И вот когда этих процессов php появляется три штуки - оперативки остается 4-6MB и CMS joomla кричит... Хотя по всей видимости проблемма с базой данных из за малого колличества свободной оперативки (скриншот прикрепил).

Скажите пожалуйста, это нормально когда запускается аж три php процесса или это возможно обойти каким-то образом (или это вообще не нормально)?

Установлены sentos, apache, nginx, xcache 512MB оперативки.
Linux mihanja80.com 2.6.18-238.9.1.el5 #1 SMP Tue Apr 12 18:10:13 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux
info.php www.videorip.info/t.php



Прошу без реплик "заплати - настроим". Хочу сам хоть немного разобраться

rtyug, не могу дождаться пока перемодерируют мое второе сообщение.

Это я видел

Скажите что посмотреть / покрутить / почитать (на словянском)

rtyug
На сайте с 13.05.2009
Offline
263
#1

swap всего 1.2Mb...

Спалил тему: Pokerstars вывод WMZ, etc на VISA 0% или SWIFT + Конверт USD/GBP,etc (net profit $0,5 млрд) (https://minfin.com.ua/blogs/94589307/115366/) Monobank - 50₴ на счет при рег. тут (https://clck.ru/DLX4r) | Номер SIP АТС Москва 7(495) - 0Ꝑ, 8(800) - 800Ꝑ/0Ꝑ (http://goo.gl/XOrCSn)
Andreyka
На сайте с 19.02.2005
Offline
822
#2

Закажи больше памяти

Джумла убогий движок

Не стоит плодить сущности без необходимости
M8
На сайте с 18.09.2011
Offline
29
#3

Вот прогнал ночью легкий тест:

Ничего не понял в результате Может кто найдет немного времени и хоть поверхностно объяснит...

P
На сайте с 08.03.2007
Offline
250
#4

Откуда стало известно, что всю память съедает? На скриншоте этого не видно, кино тоже не показывает ничего криминального, кроме странного способа тестироваться. Тривиальный ab от апача в данном случае будет проще.

ЗЫ

swap не используется - то есть памяти достаточно. И розовые вопли насчёт каких-то файловых операций, при чём тут память?

M8
На сайте с 18.09.2011
Offline
29
#5

Pilat, я просто не знаю как бороться...

When you see Warning: Invalid argument supplied for foreach() in /home/yourdom/public_html/libraries/joomla/database/database/mysqli.php on line 391 it means the host has run out of disk space on the tmp folder used for sessions and other temporary files. http://www.martynwalker.com/2011/08/21/invalid-argument-supplied-foreach-mysqliphp-line-391/

Сессии хранятся в базе данных

+

[Mon Sep 19 05:24:45 2011] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Mon Sep 19 05:24:45 2011] [error] [client **.**.17.78] Premature end of script headers: index.php, referer: http
Andreyka
На сайте с 19.02.2005
Offline
822
#6

Храни сессии в мемкеше

M8
На сайте с 18.09.2011
Offline
29
#7
Andreyka:
Храни сессии в мемкеше

Andreyka, спасибо за подсказку.

Мемкеша нет, есть xcache. Попробовать в xcache хранить сессии?

M
На сайте с 16.09.2009
Offline
50
#8

To: Mihanja80

When you see Warning: Invalid argument supplied for foreach() in /home/yourdom/public_html/libraries/joomla/database/database/mysqli.php on line 391 it means the host has run out of disk space on the tmp folder used for sessions and other temporary files. http://www.martynwalker.com/2011/08/...iphp-line-391/

Ну тут же написано что в директории /tmp не хватает места.

С памятью, судя по скринам у вас все в порядке.

3 процесса php это нормально, и память всю они не съедают, посмотрите колонку

cached - это файловый кеш. это считайте что свободная оперативка!

Увеличивайте /tmp !

Администратор Linux/FreeBSD. Лечим вирусы на сайтах. Гарантия. (http://linuxsc.pro/virussearch)
M8
На сайте с 18.09.2011
Offline
29
#9

была замечена периодичная проблема в полночь по Киеву длительностью в 4-6 минут. Сервер зависал. Написал хостеру, вот ответ:

Hello, it look like a high IO load at your
host machine. We can offer you to
migrate your server to another host
machine. This will be a live migration
and your server will be running and
reachable in this time. Should we migrate your VQ server to another
host? Best Regards

Жду переноса...

Mihanja80 добавил 20.09.2011 в 02:31

Перенесли быстро.

Проблема действительно была (MySQL через некоторое время совсем упал):

[***@mihanja80 ~]# df -h

Filesystem Size Used Avail Use% Mounted on
/dev/hda3 18G 17G 0 100% /
/dev/hda2 251M 29M 210M 12% /boot

Почистил логи и бекапы.

Теперь веселее работает 🍻

Огромное спасибо всем откликнувшимся!

M8
На сайте с 18.09.2011
Offline
29
#10

Тест (limit_conn cglob 20; в nginx. Joomla session -> Xcache):

[****@mihanja80 ~]# ab -n 1000 -c 50 http://www.videorip.info/index.php

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking www.videorip.info (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software: nginx/1.0.2
Server Hostname: www.videorip.info
Server Port: 80

Document Path: /index.php
Document Length: 212 bytes

Concurrency Level: 50
Time taken for tests: 1.312426 seconds
Complete requests: 1000
Failed requests: 10
(Connect: 0, Length: 10, Exceptions: 0)
Write errors: 0
Non-2xx responses: 990
Total transferred: 939023 bytes
HTML transferred: 765433 bytes
Requests per second: 761.95 [#/sec] (mean)
Time per request: 65.621 [ms] (mean)
Time per request: 1.312 [ms] (mean, across all concurrent requests)
Transfer rate: 698.71 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 1.9 1 11
Processing: 0 10 88.6 2 1304
Waiting: 0 9 88.6 1 1303
Total: 2 12 89.0 3 1310

Percentage of the requests served within a certain time (ms)
50% 3
66% 4
75% 4
80% 5
90% 5
95% 6
98% 12
99% 383
100% 1310 (longest request)

Тест (limit_conn cglob 25; в nginx. Joomla session -> Xcache):

[****@mihanja80 ~]# ab -n 1000 -c 50 http://www.videorip.info/index.pxp

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking www.videorip.info (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software: nginx/1.0.2
Server Hostname: www.videorip.info
Server Port: 80

Document Path: /index.pxp
Document Length: 289 bytes

Concurrency Level: 50
Time taken for tests: 0.407189 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Non-2xx responses: 1000
Total transferred: 458000 bytes
HTML transferred: 289000 bytes
Requests per second: 2455.86 [#/sec] (mean)
Time per request: 20.359 [ms] (mean)
Time per request: 0.407 [ms] (mean, across all concurrent requests)
Transfer rate: 1097.77 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 9 5.8 9 21
Processing: 1 10 4.4 10 19
Waiting: 0 8 5.1 8 18
Total: 17 19 1.8 20 25

Percentage of the requests served within a certain time (ms)
50% 20
66% 21
75% 21
80% 21
90% 22
95% 22
98% 23
99% 24
100% 25 (longest request)

Тест (limit_conn cglob 25; в nginx. Joomla session -> database):

[root@mihanja80 ~]# ab -n 1000 -c 50 http://www.videorip.info/index.php

This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking www.videorip.info (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software: nginx/1.0.2
Server Hostname: www.videorip.info
Server Port: 80

Document Path: /index.php
Document Length: 212 bytes

Concurrency Level: 50
Time taken for tests: 3.551755 seconds
Complete requests: 1000
Failed requests: 25
(Connect: 0, Length: 25, Exceptions: 0)
Write errors: 0
Non-2xx responses: 975
Total transferred: 1773330 bytes
HTML transferred: 1595855 bytes
Requests per second: 281.55 [#/sec] (mean)
Time per request: 177.588 [ms] (mean)
Time per request: 3.552 [ms] (mean, across all concurrent requests)
Transfer rate: 487.36 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 2.9 0 15
Processing: 2 60 374.9 3 3538
Waiting: 2 60 374.8 3 3538
Total: 2 61 376.5 3 3549

Percentage of the requests served within a certain time (ms)
50% 3
66% 3
75% 3
80% 5
90% 14
95% 26
98% 1393
99% 2636
100% 3549 (longest request)

Скажите, пожалуйста, это нормальный результат?

12

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий