Quantcast
Channel: Nginx Forum - Php-fpm Mailing List - English
Viewing all 219 articles
Browse latest View live

PHP Fatal error with nginx (no replies)

$
0
0
Hello!

I'm having, in a PHP form, when I'm submiting one email, the next error in
error.log:

2013/08/03 21:39:22 [error] 19544#0: *11 FastCGI sent in stderr: "PHP
message: PHP Warning:
require_once(TEMPLATEPATH/functions/theme-functions.php): failed to open
stream: No such file or directory in
/web/domain.com/public/wp-content/themes/launcheffect/functions.php on line
151

PHP message: PHP Fatal error: require_once(): Failed opening required
'TEMPLATEPATH/functions/theme-functions.php'
(include_path='.:/usr/share/php:/usr/share/pear') in
/web/domain.com/public/wp-content/themes/launcheffect/functions.php on line
151" while reading response header from upstream, client: 71.28.74.212,
server: www.domain.com, request: "POST
/wp-content/themes/launcheffect/post.php HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "www.domain.com", referrer:
"http://www.domain.com/"

I've been reading about permissions, about nginx and fastcgi, about PHPfpm,
reviewing my config...without success.

Of course I've that file/directory.

My nginx.conf:

http://pastebin.com/5VB1BzHj

Can anyone help me to solve this error?

Thanks in advance!

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

PHP Fatal error with nginx (4 replies)

$
0
0
Hello!

I'm having, in a PHP form, when I'm submiting one email, the next error in
error.log:

2013/08/03 21:39:22 [error] 19544#0: *11 FastCGI sent in stderr: "PHP
message: PHP Warning:
require_once(TEMPLATEPATH/functions/theme-functions.php): failed to open
stream: No such file or directory in
/web/domain.com/public/wp-content/themes/launcheffect/functions.php on line
151

PHP message: PHP Fatal error: require_once(): Failed opening required
'TEMPLATEPATH/functions/theme-functions.php'
(include_path='.:/usr/share/php:/usr/share/pear') in
/web/domain.com/public/wp-content/themes/launcheffect/functions.php on line
151" while reading response header from upstream, client: 71.28.74.212,
server: www.domain.com, request: "POST
/wp-content/themes/launcheffect/post.php HTTP/1.1", upstream:
"fastcgi://127.0.0.1:9000", host: "www.domain.com", referrer:
"http://www.domain.com/"

I've been reading about permissions, about nginx and fastcgi, about PHPfpm,
reviewing my config...without success.

Of course I've that file/directory.

Can anyone help me to solve this error?

Thanks in advance!

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

PHP-FPM 100% Load (2 replies)

$
0
0
When I stress the my server for 10s the php-fpm goes to 100% and stays for
22 seconds, imagine if someone DoS attack my server will be down in a few
seconds.

If I do more threads then I have to restart php-fpm then it goes normal.

Here is the htop: http://i.imgur.com/IZaT1RW.png (High load)

PHP5-FPM Log: http://pastebin.com/PV8vgsEx - Thats the latest, some of it.

PHP Info http://pastebin.com/Qf8kvEuk

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Start only specific pool (1 reply)

$
0
0
Hi there,

I am using Cherokee web server and try to set up a shared hosting
environment. In Cherokee every virtual host gets it's own *information
source* that starts a php-fpm child-process using: *php5-fpm --fpm-config
/etc/php5/fpm/php-fpm.conf* and then excahnges data with the socket of that
specific pool. Currently every information source fires up a
child-php-fpm-process with all existing pools.

Is there a way to only run one specific php-fpm pool?

Thanks in advance.

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

accelerated upload (1 reply)

$
0
0
Hi All,

I am doing some comparison to test if accelerated support is really better,
so i am testing:

nginx+php-fpm *with* accelerated support
nginx+php-fpm *without* accelerated support
nginx_php-cgi only

uploading a 350MB file. and using this config:

location ~ \.php$ {
include fastcgi_params;

client_body_temp_path /temp;
fastcgi_pass_request_body off;
client_body_in_file_only on;
fastcgi_param REQUEST_BODY_FILE $request_body_file;

#use php-cgi
#fastcgi_pass 127.0.0.1:10005;

#use php-fpm
fastcgi_pass 127.0.0.1:9000;

fastcgi_index $dir_index;
fastcgi_param DOCUMENT_ROOT $doc_root;
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
}

but am i missing something on PHP side or config side as it seems i am
getting the same response time using php-fpm without the accelerated
support settings
and also using php-cgi, response time is the same for all scenarios.


with accelerated support using php-fpm:
10.254.12.84 - - [15/Aug/2013:10:26:05 +0800] "POST /curlupload.php
HTTP/1.1" 200 359 "-" "-" "-" 33.404 1.342 .
10.254.12.84 - - [15/Aug/2013:10:26:51 +0800] "POST /curlupload.php
HTTP/1.1" 200 359 "-" "-" "-" 32.168 1.216 .

without accelerated support using php-fpm:
10.254.12.84 - - [15/Aug/2013:11:02:58 +0800] "POST /curlupload.php
HTTP/1.1" 200 359 "-" "-" "-" 32.182 1.229 .
10.254.12.84 - - [15/Aug/2013:11:03:32 +0800] "POST /curlupload.php
HTTP/1.1" 200 359 "-" "-" "-" 33.218 1.208 .

using php-cgi
10.254.12.84 - - [15/Aug/2013:11:48:57 +0800] "POST /curlupload.php
HTTP/1.1" 200 359 "-" "-" "-" 32.371 1.418 .
10.254.12.84 - - [15/Aug/2013:11:49:30 +0800] "POST /curlupload.php
HTTP/1.1" 200 359 "-" "-" "-" 33.093 1.308 .

TIA

Regards,
Ron

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

php-fpm crashes with pac module (no replies)

$
0
0
it's really strange, but when I active APC module, my php-fpm core dump… I dunno how ti fix it, any suggest?

I use FreeBSD 9.1 AMD64 with PHP 5.3.27 compiled by ports

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Installing Centos 6 - Nginx - PHP-fpm - GitList (and OSTicket) (6 replies)

$
0
0
Installed Centos 6 (selinux disabled) - NGINX - PHP-fpm when I access my URL I get a server error (The website encountered an error while retrieving http://git.sastratechnologies.net/. It may be down for maintenance or configured incorrectly.)

Here is what I did
1. Installed php (php and php-fpm)
2. Configure php (cgi.fix_pathinfo=0)
3. Configure /etc/php-fpm.d/www.conf and replaced user group with nginx
4. Changed nginx default.conf and increased worker process to 4
5. Created a virtual host by mapping an URL. Tested with php.info and found it working
6. Removed php.info.
7. Followed the instructions on github and installed gitlist by cloning, created cache directory, made it writable, changed paths in config.ini
7. Used the nginx virtual host configuration provided in the installation instructions on GitHub(I noticed the listen directive missing. I had to Include the listen directive to listen on git.sastratechnologies.net without it I was being redirected to the other vhost that had bugzilla. Changed the paths appropriately restarted nginx
8. Accessed the URL and I get the server error 500
9. Access log has the entry (122.164.43.240 - - [14/Aug/2013:14:47:13 +0000] "-" 400 0 "-" "-") and Error logs do not have entries

I then went on to install Osticket and used the VHOST configuration provided in the NGINX wiki, I get the same error. Has anyone had a similar experience. Would like to hear from you.

Regards,

Sridhar Pandurangiah

php 5.2.17 fpm config (3 replies)

$
0
0
Hello Everyone!

I just build a system with php-5.3 and 5.4 with fpm.
It now both working with a similar config files.
But 5.2.17 after compile requires a xml configuration file. Is there any
solution with can get to work with the ini file-style?



--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Help make code secure (no replies)

$
0
0
Sorry to intrude your mailbox

I have created a real time PHP code compiler at http://web.guru99.com
Although I have checked all security loopholes … do you experts see any
major security leak that I need to care of?


--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

One unix socket for all php-fpm pools - possible? (1 reply)

$
0
0
I want to set only one listening unix socket for all php-fpm pools, but fpm requires them to be deferent. Production server has 2 gb ram and i noticed that it started to be not enough, adding more websites spawn more fpm processes. Me is only one user on this server, so i don't need to limit resources per pool just want to set common config settings for all. One domain pool as follows:
[domain.com]
user = www
group = www
listen = /tmp/domain.com-php-fpm.sock
security.limit_extensions = .php .html

;Resources
pm = dynamic
pm.max_children = 9
pm.start_servers = 3
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.process_idle_timeout = 60s
request_terminate_timeout = 30s
pm.max_requests = 300

;Log errors
catch_workers_output = yes
php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/www/domain.com/php-error.log

;Base dirs
php_admin_value[open_basedir] = /usr/local/www/domain.com
php_admin_value[upload_tmp_dir] = /usr/local/www/domain.com/tmp
php_admin_value[session.save_path] = /usr/local/www/domain.com/tmp

Another pool is the name, except domain name. So then if I set same listening socket for both pools it doesn't work

# php-fpm --test
[12-Sep-2013 22:27:01] ERROR: [pool domain.com] unable to set listen address as it's already used in another pool 'domain2.com'
[12-Sep-2013 22:27:01] ERROR: failed to post process the configuration
[12-Sep-2013 22:27:01] ERROR: FPM initialization failed

And if set deferent sockets, it works, but each pool spawn minimum 3 process. (Sure, this is not an output from real server, just simulated same behavior).

# ps aux | grep php-fpm
root 1349 0.0 0.9 161376 18320 ?? Ss 10:34PM 0:00.02 php-fpm: master process (/usr/local/etc/php-fpm.conf) (php-fpm)
www 1350 0.0 0.9 161336 18292 ?? S 10:34PM 0:00.00 php-fpm: pool domain2.com (php-fpm)
www 1351 0.0 0.9 161336 18292 ?? S 10:34PM 0:00.00 php-fpm: pool domain2.com (php-fpm)
www 1352 0.0 0.9 161336 18292 ?? S 10:34PM 0:00.00 php-fpm: pool domain2.com (php-fpm)
www 1353 0.0 0.9 161336 18292 ?? S 10:34PM 0:00.00 php-fpm: pool domain.com (php-fpm)
www 1354 0.0 0.9 161336 18292 ?? S 10:34PM 0:00.00 php-fpm: pool domain.com (php-fpm)
www 1355 0.0 0.9 161336 18292 ?? S 10:34PM 0:00.00 php-fpm: pool domain.com (php-fpm)

My intention is to keep running 3 php-fpm processes for all pools.

Using php-fpm to serve a wordpress blog. (no replies)

$
0
0
Hello,

I am trying to serve a wordpress blog with nginx and used the following commands to setup the server.


sudo apt-get update
sudo apt-get install mysql-server php5-fpm nginx
sudo service nginx start

sudo nano /etc/php5/fpm/php.ini
Find the line, cgi.fix_pathinfo=1, and change the 1 to 0.
cgi.fix_pathinfo=0

sudo service php5-fpm restart

sudo nano /etc/nginx/sites-available/default
server {
listen 80;


root /usr/share/nginx/www;
index index.php index.html index.htm;

server_name example.com;

location / {
try_files $uri $uri/ /index.html;
}

error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;

}

}

sudo nano /etc/php5/fpm/pool.d/www.conf
replace "listen = 127.0.0.1:9000" with "listen = /var/run/php5-fpm.sock;"

sudo service nginx restart
sudo service php5-fpm restart

Now I am trying to use a word press plugin and it seems to be causing an error.

11161#0: *1 FastCGI sent in stderr: "PHP message: PHP Warning: gzinflate(): data error in /usr/share/nginx/www/wp-content/plugins/fb-linkedin-resume/fb-linkedin-resume.php on line 111" while reading upstream, client: xx.xx.xx.xx, server: servername.com, request: "GET /index.php/somepage/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "servername.com", referrer: "http://servername.com/"

What do i need to change to resolve this issue?

PHP-FPM Won't load IonCube after php recompiling (1 reply)

$
0
0
Hey,

I have installed IonCube on PHP-FPM once without an issue, but.

Some of the modules were not working (not because of ioncube) and I needed
to recompile PHP-FPM, so now the PHP version is 5.4.19. Everything was
working without any issues, but I realised that IonCube is not getting
loaded... I checked the .so file is there (5.4) and there is the
ioncube.ini file as well. I even tried loading it in php-fpm.conf and
nothing. I checked with the info.php file, and I didn't see IonCube loaded.

Does anyone have any idea what could be causing this?

Regards,

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

fpm crashes (no replies)

$
0
0
We notice that php-fpm crashes often, we tried to strace on child PIDs

========================================================================
lseek(26, 0, SEEK_CUR) = 0 <0.000009>
read(26, "#<IfModule mod_rewrite.c>\n#Rewri"..., 8192) = 1223 <0.000012>
read(26, "", 8192) = 0 <0.000010>
close(26) = 0 <0.000010>
setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={60, 0}}, NULL) = 0 <0.000011>
rt_sigaction(SIGPROF, {0x70d0a0, [PROF], SA_RESTORER|SA_RESTART, 0x32006302d0}, {0x70d0a0, [PROF], SA_RESTORER|SA_RESTART, 0x32006302d0}, 8) = 0 <0.000010>
rt_sigprocmask(SIG_UNBLOCK, [PROF], NULL, 8) = 0 <0.000010>
write(25, "\0\0\30\202\0\0\0\5start\0\t\0\0\r6\0\0\0\3php\0\0\0\0102."..., 6278) = 6278 <0.003570>
read(25, 0x1515bc0, 16383) = -1 EAGAIN (Resource temporarily unavailable) <0.099852>
read(25, 0x1515bc0, 16383) = -1 EAGAIN (Resource temporarily unavailable) <0.099936>
read(25, 0x1515bc0, 16383) = -1 EAGAIN (Resource temporarily unavailable) <0.100608>
read(25, 0x1515bc0, 16383) = -1 EAGAIN (Resource temporarily unavailable) <0.099222>
read(25, 0x1515bc0, 16383) = -1 EAGAIN (Resource temporarily unavailable) <0.100014>
read(25, 0x1515bc0, 16383) = -1 EAGAIN (Resource temporarily unavailable) <0.100200>
read(25, 0x1515bc0, 16383) = -1 EAGAIN (Resource temporarily unavailable) <0.099569>
=====================================================================================


this read system call executes multiple times and php scripts times out (after 30seconds)

Anyone know what does that mean?

Thanks
Vij

php-fpm + persistent sockets = frequent 502 bad gateway (14 replies)

$
0
0
Hello all,

Put on your reading glasses - this will be a long-ish one.

First, what I'm doing. I'm building a web-app interface for some
particularly slow tcp devices. Opening a socket to them takes 200ms and an
fwrite/fread cycle takes another 300ms. To reduce the need for both of
these actions on each request, I'm opening a persistent tcp socket which
reduces the response time by the aforementioned 200ms. I was hoping PHP-FPM
would share the persistent connections between requests from different
clients (and indeed it does!), but there are some issues which I havent
been able to resolve after 2 days of interneting, reading logs and
modifying settings. I have somewhat narrowed it down though.

Setup:
- Ubuntu 13.04 x64 Server (fully updated) on Linode
- PHP 5.5.0-6~raring+1 (fpm-fcgi)
- nginx/1.5.2

Relevent config:
nginx
-----
worker_processes 4;

php-fpm/pool.d
--------------
pm = dynamic
pm.max_children = 2
pm.start_servers = 2
pm.min_spare_servers = 2

Let's go from coarse to fine detail of what happens. After a fresh start I
have 4x nginx processes and 2x php5-fpm processes waiting to handle
requests. Then I send requests every couple seconds to the script. The
first take a while to open the socket connection and returns with the data
in about 500ms, the second returns data in 300ms (yay it's re-using the
socket), the third also succeeds in about 300ms, the fourth request = 502
Bad Gateway, same with the 5th. Sixth request once again returns data,
except now it took 500ms again. The process repeats for several cycles
after which every 4 requests result in 2x 502 Bad Gateways and 2x 500ms
Data responses.

If I double all the fpm pool values and have 4x php-fpm processes running,
the cycles settles in with 4x successful 500ms responses followed by 4x Bad
Gateway errors. If I don't use persistent sockets, this issue goes away but
then every request is 500ms. What I suspect is happening is the persistent
socket keeps each php-fpm process from idling and ties it up, so the next
one gets chosen until none are left and as they error out, maybe they are
restarted and become available on the next round-robin loop ut the socket
dies with the process. I haven't yet checked the 'slowlog', but the nginx
error log shows lots of this:

*188 recv() failed (104: Connection reset by peer) while reading response
header from upstream, client:...

All the suggestions on the internet regarding fixing nginx/php-fpm/502 bad
gateway relate to high load or fcgi_pass misconfiguration. This is not the
case here. Increasing buffers/sizes, changing timeouts, switching from unix
socket to tcp socket for fcgi_pass, upping connection limits on the
system....none of this stuff applies here.

I've had some other success with setting pm = ondemand rather than dynamic,
but as soon as the initial fpm-process gets killed off after idling, the
persistent socket is gone for all subsequent php-fpm spawns. For the php
script, I'm using stream_socket_client() with a STREAM_CLIENT_PERSISTENT
flag. A while/stream_select() loop to detect socket data and fread($sock,
4096) to grab the data. I don't call fclose() obviously.

If anyone has some additional questions or advice on how to get a
persistent socket without tying up the php-fpm processes beyond the request
completion, or maybe some other things to try, I'd appreciate it.

some useful links:
http://serverfault.com/questions/302...fpm-recv-errorhttp://serverfault.com/questions/302822/nginx-php-fpm-recv-error
http://serverfault.com/questions/178...d-on-a-test-sehttp://serverfault.com/questions/178671/nginx-php-fpm-504-gateway-time-out-error-with-almost-zero-load-on-a-test-se
http://serverfault.com/questions/520...onal-duplicatehttp://serverfault.com/questions/520283/nginx-php-fpm-error-104-connection-reset-by-peer-causes-occasional-duplicate
http://www.linuxquestions.org/questi...ckopen-552084/http://www.linuxquestions.org/questions/programming-9/php-pfsockopen-552084/
http://stackoverflow.com/questions/1...ent-php-sockethttp://stackoverflow.com/questions/14268018/concurrent-use-of-a-persistent-php-socket
http://devzone.zend.com/303/extensio...zend/#Heading3<http://devzone.zend.com/303/extension-writing-part-i-introduction-to-php-and-zend/#Heading3>
http://stackoverflow.com/questions/2...m-socket-alivehttp://stackoverflow.com/questions/242316/how-to-keep-a-php-stream-socket-alive
http://php.net/manual/en/install.fpm.configuration.php
https://www.google.com/search?q=recv...&bih=953&dpr=1https://www.google.com/search?q=recv%28%29+failed+%28104:+Connection+reset+by+peer%29+while+reading+response+header+from+upstream+%22502%22&ei=mC1XUrm7F4WQyAHbv4H4AQ&start=10&sa=N&biw=1920&bih=953&dpr=1

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

php-fpm restart 4 times a day (13 replies)

$
0
0
Hello

Do you know about any setting in hp-fpm that will restart the server at
regular intervals?

I have a server that close all children and restarts at hours 12, 18, 0 and
6 each day no matter what and it's driving me crazy.

Any hints appreciated...

Thank you

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

502 Errors are the bane of my existence (1 reply)

$
0
0
I'm running a production server with nginx and php-fpm ... I had a
configuration that worked for ages, but with recent botnet attacks towards
Wordpress, and generally increased traffic from search bots and actual
humans, we've been crippled with 502 errors, as I'm fairly sure php-fpm is
crashing.... hard.

So, this is our current www.conf .... any ideas what I'm doing wrong? We're
on a VPS with 4gb ram ... nginx, php-fpm, wordpress, APC, running 2
instances of Wordpress. If this config file looks like I have no clue what
I'm doing, it's because I have no clue what I'm doing.

[www]
;prefix = /path/to/pools/$pool
listen = 127.0.0.1:9000
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
listen.mode = 0666
user = www
group = www
pm = dynamic
pm.max_children = 100
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 15
pm.max_requests = 50
pm.status_path = /fpmstatus
ping.path = /ping
ping.response = pong
request_terminate_timeout = 1000
request_slowlog_timeout = 1000
slowlog = /var/log/$pool.log.slow
;rlimit_files = 1024
;rlimit_core = 0
;chroot =
;chdir = /
catch_workers_output = yes
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f
www@my.domain.com
php_flag[display_errors] = on
php_admin_value[error_log] = /var/log/fpm-php.www.log
php_admin_flag[log_errors] = on
php_admin_value[memory_limit] = 256M
php_admin_value[date.timezone] = America/Toronto
php_value[upload_max_filesize] = 20M
php_value[max_execution_time] = 7

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

session overlap during high load, forking problem? (8 replies)

$
0
0
Hey Guys,

Our Software was hit at a rate of 1k hits/s.
To compensate we had 6 servers to spread it out, each of them should
handle this rate easily, but the number of hits spiked to 5k per sec and
php-fpm
spawning went through the roof. We experienced that all servers couldn't
spawn any more child processes and
ran at 200 childs throwing around warnings like christmas presents.
Exactly at that moment our first sessions overlapped. This overlap
happened a few times after also, but always with the same session. So we
had 70 Users crawling in one session. Our sessionhandling is in memcache
handled over tcp. We can show that it is not some kind of malicious session
hijacking.
Also: the application wasn't accessible online and the first error was
reported 8
minutes after it went online. That's to fast to find an error and use it
maliciously in a closed environment.

We are pretty sure the communication between memcache and php-fpm is the
problem. All phenomens can be explained by that. But, we are not quite sure
why this happens.

First Idea: forking and distributing file or socket descriptors with the
fork. Phusion Passenger apparently has that problem with shared memcache
connection if the application spawner opens the connection and
the connection isn't re-established. But as far as i know, php-fpm doesn't
fork from childs.
Could it happen during extrem situationen that processes get forked by
childs?
Does the master php-fpm process handle any request? That would mean a
freakish accident, which
likelyhood to happen is to win the royal lottery...
Because you need an open memcache connection and exactly at that time you
would need
to fork that process.

Next idea: memory corruption or some kind of memory sharing between
processes. That's too deep into php-fpm and i don't know if anything
like this exists even. And that error wasn't happening for a
short amount time, coz the error propagates from user to user for around
2h. With a process handling 500 requests before it kills itself and that
hit rate,
there's no single process which could have survived that long.

I am up for any idea ... coz my best bet is in idea one. It explains
everything to cleanly.


--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

low load average , long http response time latency, (3 replies)

$
0
0
on normal time ,php-fpm has 30+ process. all request finished in 10
seconds. (i execute commands "netstat -nap|wc -l" ,it show 23000,
and "netstat -nap|grep 9000|wc -l" shows 7600)
on busy time ,php-fpm has 40+ process(with a lot of concurrent request) ,
lots of requests get 499 response code( i know because i set php-fpm to
terminate the request executing over 10 seconds) ,according nginx acess
log, and almost all of them dosen't have a $upstream_response_time, but
only $request_time. the server has a load average of 5-9,cpu usage at
30%, no %system busy ,no $io busy. execute "netstat -nap|wc -l" ,it
show 43000, and "netstat -nap|grep 9000|wc -l" shows 18000+

why on busy time ,the php-fpm dosen't response any thing to nginx server
,but the server seems not busy ?



System setup:
RHEL 5.4
nginx 0.8.45
php.5.3.6 with php-fpm .

nginx.conf:


log_format main
'$remote_addr\t$remote_user\t$time_local\t$request\t$status\t$body_bytes_sent\t$http_referer\t$http_user_agent\t$content_length\t$request_time\t$upstream_response_time\t$sent_http_content_type\t$sent_http_transfer_encoding\t$http_m\t$request_body';

server_names_hash_bucket_size 128;
client_header_buffer_size 128k;
large_client_header_buffers 8 128k;
client_max_body_size 200m;
client_body_buffer_size 128k;

proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_buffer_size 16k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;

fastcgi_connect_timeout 60;
fastcgi_send_timeout 60;
fastcgi_read_timeout 60;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 128k;
fastcgi_intercept_errors on;

php-fpm.conf:
pm = dynamic
pm.max_children = 300
pm.start_servers = 10
pm.min_spare_servers = 5
pm.max_spare_servers = 15
pm.max_requests = 2000

request_terminate_timeout = 10s
request_slowlog_timeout =2s

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

*3 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'SmartyException' (no replies)

$
0
0
hi guys,
here I will test when I nginx is really good but I have an unsolvable bug me then I ask for your aide.J 'I install php5-fpm postfix and postfixadmin-relay and it makes me weird error
*3 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'SmartyException'
all other error related to the smarty
nginx+php5-fpm+mariadb+postfix+postfixadmin-relay
thank for you help and sorry for my english not very well

PHP-CGI Dynamic Variable Environement unknow (no replies)

$
0
0
Greetings,

I have installed the latest version of PHP-FPM, Apache and mod_fastcgi.

All is working, except the ENV arn't GLOBAL.
I can get the IP of the visitor with $_SERVER['REMOTE_ADDR'] from a script
PHP, but i can't use this information from my mail wrapper sendmail.pl
wrote in Perl.

Before to use PHP-FPM / FastCGI, i had suphp and all were correct, even
inside my wrapper sendmail.pl in Perl.

When i check my phpinfo(), "Environment" is mostly empty, i have only USER
and HOME.

I know i can fill this part with php-fpm.conf with this :
env[MY_ENV_VAR_1] = 'value1'

and it's working, this variable is global. But how can i set REMOTE_ADDR
which is a dynamic value with the visitor ?

I have tried this :
env[REMOTE_ADDR] = $REMOTE_ADDR

but the variable $REMOTE_ADDR is empty, even if $_SERVER["REMOTE_ADDR"] is
still here, but not in GLOBAL.

I have tried this :
env[REMOTE_ADDR] = $_SERVER["REMOTE_ADDR"]

And $REMOTE_ADDR is still empty.

I have tried again this :
env[REMOTE_ADDR] = $_SERVER["REMOTE-ADDR"]

And $REMOTE_ADDR is always empty, even if $_SERVER["REMOTE_ADDR"] is still
here.

Do you have an idea please ?

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Viewing all 219 articles
Browse latest View live