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

Re: Modifying default umask for PHP-FPM (no replies)

$
0
0
You may be using upstart on ubuntu. If so then see if
/etc/init/php5-fpm.conf exists. If it does, edit that file and add `umask
0002` (or whatever umask you like). See
http://stackoverflow.com/questions/21248904 for an explanation.

On Monday, 30 January 2012 10:47:49 UTC+13, Brian Mercer wrote:
>
> On Saturday, December 24, 2011 11:38:55 PM UTC-5, ominds wrote:
>>
>> Perfect. Thanks. In case anyone needs this on ubuntu, I modified the
>> script located in:
>>
>> /etc/init.d/php5-fpm and changed the following in do_start()
>>
>> start-stop-daemon --start --quiet ......
>>
>> to
>>
>> start-stop-daemon --umask 0007 --start --quiet ......
>>
>> Can't say I tested it. But I think it will do.
>>
>>
>>
>> On Dec 24, 10:13 pm, Antony Dovgal <t....@daylessday.org> wrote:
>> > On 12/24/2011 09:06 PM, ominds wrote:
>> >
>> > > I want files written by PHP-FPM to have umask 0002 without having to
>> > > modify each PHP application and call the umask() PHP function. Is
>> > > there a way I can do that?
>> >
>> > > I have way too many scripts, many of which are ready PHP apps (e.g.
>> > > wordpress, Drupal) that I prefer not modifying individually. PHP-FPM
>> > > is called by NGINX if that makes any difference.
>> >
>> > Add "umask <value>" to the script that starts FPM in your distro,
>> whatever it is.
>> >
>> > --
>> > Wbr,
>> > Antony Dovgal
>> > ---http://pinba.org- realtime profiling for PHP
>
>
>
> I've tried this on Ubuntu 11.10 and I can't get it to work.
>
> If I'm starting the php-fpm master process with start-stop-daemon --umask
> 0007 as root, and then that root master process spawns the workers as
> www-data, are those children supposed to inherit the umask?
>

--

---
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.

DirectoryIndex index.php w/ php-fpm & mod_proxy_fcgi (no replies)

$
0
0
Hello,

I am currently setting up php-fpm with mod_proxy_fcgi to replace a mod_php
configuration, and I can't seem to get DirectoryIndex to work with php
files, since this also routes requests for directories without am index.php
file (where one would e.g. be served a directory listing) through the proxy
to php-fpm, which then outputs "File not found.".

There seem to be somewhat a way to avoid this, using a RewriteRule rather
than ProxyPassMatch, but I hope to avoid going down this route (especially
since the Apache documentation recommends against doing so for performance
reasons, which is my motivation for this endeavor in the first place).

Any other ideas? Is this something that is being worked on?

Relevant threads:
http://serverfault.com/questions/553899/forwarding-php-requests-via-proxypassmatch-as-a-handler-or-only-when-file-exist
http://marc.info/?l=apache-httpd-users&m=134765077523168&w=1
https://groups.google.com/forum/#!topic/highload-php-en/qe2R7T939JM

Thanks!
Gottfried

--

---
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 graceful reload, really ? (no replies)

$
0
0
Hi,

I have an app using Nginx/php-fpm which make long request, 1 minutes sometimes and sometimes my app have to do the command /etc/init.d/php5-fpm reload under Debian Wheezy, it send a USR 2 signal and the active connections and not supposed to be closed but it does'nt work, i immediately have this in nginx logs :

[error] 245639#0: *168 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1,

Does someone have a possible solution for this ?

Thank you,

Apache 5.4.7 to PHP-FPM via sockets + patch: DNS lookup failure (1 reply)

$
0
0
Hi all,

I would like to have Apache 2.4.7 working with PHP-FPM through Unix sockets.

First of all, I downloaded this patch for Apache
2.4.7: https://issues.apache.org/bugzilla/attachment.cgi?id=31232&action=diff&context=patch&collapsed=&headers=1&format=raw

Then I patched the Apache source code successfully (I think):

/usr/local/src/httpd-2.4.7/modules/proxy# patch < patch247.patch
patching file mod_proxy_balancer.c
patching file proxy_util.c
patching file mod_proxy.c
Hunk #1 succeeded at 1335 (offset -35 lines).
Hunk #2 succeeded at 1409 (offset -35 lines).
Hunk #3 succeeded at 1530 (offset -35 lines).
Hunk #4 succeeded at 1566 (offset -35 lines).
Hunk #5 succeeded at 1578 (offset -35 lines).
Hunk #6 succeeded at 2042 (offset -35 lines).
Hunk #7 succeeded at 2051 (offset -35 lines).
Hunk #8 succeeded at 2066 (offset -35 lines).
Hunk #9 succeeded at 2128 (offset -35 lines).
Hunk #10 succeeded at 2274 (offset -29 lines).
patching file mod_proxy.h
Hunk #1 succeeded at 249 (offset -4 lines).
Hunk #2 succeeded at 342 (offset -4 lines).
Hunk #3 succeeded at 588 (offset -4 lines).

I followed the description
here: https://issues.apache.org/bugzilla/show_bug.cgi?id=54101

After compiling and installing Apache I added this in my httpd-vhosts.conf
(I only have one VirtualHost, so *):

<VirtualHost *>
[...]
<LocationMatch ^(.*\.php)$>
ProxyPass
fcgi://socket=%2fdev%2fshm%2fweblogzwolle-php.sock/home/weblogzwolle/www/
</LocationMatch>
RewriteRule (.*\.php)
fcgi://socket=\%2fdev\%2fshm\%2fweblogzwolle-php.sock/home/weblogzwolle/www/$1
[P,L]
[...]
</VirtualHost>

My PHP-FPM socket is /dev/shm/weblogzwolle-php.sock and my root folder path
is /home/weblogzwolle/www/.

When I visit a .php page, I receive this 502-error in my browser:

*Proxy Error*

*The proxy server received an invalid response from an upstream server.*
*The proxy server could not handle the request GET /index.php.*

*Reason: DNS lookup failure for:
socket=%2fdev%2fshm%2fweblogzwolle-php.sock*

What am I doing wrong? Do you have any ideas? Am I doing something wrong
with that patch?

Thanks!

--

---
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.

Socket Not Being Created (2 replies)

$
0
0
I am running nginx with php5-fpm on Ubuntu. I just noticed one of my
websites isn't working anymore, I was getting a 502 error. After looking at
the nginx error log I could see it was not finding the php-fpm socket, and
I looked at the sockets directory and sure enough it is not there but the
config file is in pool.d to create it.I tried relaoding php5-fpm and even
rebooted the server entirely, nothing worked.

Any ideas?

--

---
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 chroot issues (no replies)

$
0
0
Hi All,

I'm trying to install Piwigo version: 2.6.1 on OpenBSD 5.4 stable with
nginx 1.4.1, PHP version: 5.3.27,
MySQL version: 5.1.70 and php-fpm chrooted.


I have successfully done this without php-fpm being rooted, but for
security I'm trying to segregate my sites.

Here are the errors i'm getting in the logs:

2014/02/14 14:17:58 [error] 3371#0: *16 FastCGI sent in stderr: "PHP
message: PHP Warning:
include(/var/www/piwigo/include/smarty/libs/plugins/function.html_options.php):
failed to open stream: No such file or directory in
/_data/templates_c/p6jhns^eccdaec59014a38fe07618ca820aded387b09ba6.file.install.tpl.php
on line 52
PHP message: PHP Warning: include(): Failed opening
'/var/www/piwigo/include/smarty/libs/plugins/function.html_options.php' for
inclusion (include_path='.:/pear/lib:/var/www/pear/lib') in
/_data/templates_c/p6jhns^eccdaec59014a38fe07618ca820aded387b09ba6.file.install.tpl.php
on line 52
PHP message: PHP Fatal error: Call to undefined function
smarty_function_html_options() in
/_data/templates_c/p6jhns^eccdaec59014a38fe07618ca820aded387b09ba6.file.install.tpl.php
on line 304" while reading response header from upstream, client:
75.150.73.57, server: piwigo.entiret.com, request: "GET /install.php
HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "piwigo.domain.com"

I tried adding /var/www/piwigo/includes/smarty/libs and
/var/www/piwigo/includes/smarty/libs/plugins as well as
/includes/smarty/libs and /includes/smarty/libs/plugins to my php
include_path but that didn't help.

Any help greatly appreciated, my php-fpm config is below.

Aaron

/etc/php-fpm.conf:

error_log = /var/log/php-fpm.error.log
; alert, error, warning, notice, debug
; log_level = error
; log_level = debug
log_level = notice

[piwigo]
chroot = /var/www/piwigo

user = www
group = www

listen = 127.0.0.1:9000

listen.owner = www
listen.group = www
listen.mode = 0666

listen.allowed_clients = 127.0.0.1

pm = dynamic
pm.max_children = 25
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10

php_admin_value[memory_limit] = 256M
php_admin_value[safe_mode] = off
php_admin_value[register_globals] = off
php_admin_value[magic_quotes_gpc] = off
;php_admin_value[session.save_path] = /tmp
php_admin_value[suhosin.get.max_value_length] = 5172
;php_admin_value[include_path] = include/smarty/libs/plugins
;php_admin_value[disable_functions] = dir,chdir,opendir,readdir
php_value[session.save_handler] = files

--

---
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 futex problem (no replies)

$
0
0
php-fpm runs into futex_wait.

futex(0x2b01a4d57088, FUTEX_WAIT, 2, NULL) = -1 EAGAIN (Resource temporarily unavailable)
futex(0x2b01a4d57088, FUTEX_WAKE, 1) = 0

What is php-fpm trying to lock to..?

Sometimes it goes into FUTEX_WAIT and never recovers


27321 19:54:17.275637 futex(0x2b7adf7dd088, FUTEX_WAIT, 2, NULL <unfinished ...>
27433 19:54:19.427321 open("/etc/group", O_RDONLY <unfinished ...>
27452 19:54:20.527321 <... stat resumed> {st_mode=S_IFREG|0644, st_size=5552, ...}) = 0
27488 19:54:21.327321 close(357 <unfinished ...>
27321 19:54:21.384084 <... futex resumed> ) = -1 EINTR (Interrupted system call)
27321 19:54:21.384876 --- SIGTERM (Terminated) @ 0 (0) ---
27512 19:54:21.627321 close(76 <unfinished ...>


All the child processes are going into futex_wait and are ultimately getting killed after execution_timeout
The new child processes created also follow the same... and ultimately we have to restart php-fpm or wait
for php-fpm to recover after a random time(some mins/hours)

php-fpm become slower after deploy new php code (9 replies)

$
0
0
hi all:


We deploy single entry PHP program with php-fpm & nginx. We use a single
entry PHP with version file to switch product version.

Just like the following code:

<?php
>
> $version = file_get_contents('version');
>
> require_once "/home/www/release/$version/init.php";
>
> dispatch();
>

The problem is that when we deploy a new version, the php-fpm will
become slower after a while so that it cannot handle any request.

After I restart php-fpm, it works properly.

Any idea or suggestion will be appreciated.

--

---
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.

httpd 2.2, vhost_alias, php-fpm, "dynamic" pool selection ? (no replies)

$
0
0
Hello everyone,

On Debian Wheezy, I'm configuring Apache (2.2) to work with mod_fastcgi,
mod_vhost_alias and php-fpm.

FastCgiExternalServer connects to a user-specific pool, that's the easy
part.

However, I need to use mod_vhost_alias and I'd like that Apache deduce the
FastCgiExternalServer socket in the same way I setuped VirtualDocumentRoot.

Here's an example of vhost configuration I'd like to do:

<VirtualHost *:80>

ServerAdmin webmaster@example.com
ServerName example.com
ServerAlias *

DocumentRoot /home/example/www/
VirtualDocumentRoot /home/%2/%1/

FastCgiExternalServer /fcgi-bin-php5-fpm-%2 -socket
/var/run/php5-fpm-%2.sock -pass-header Authorization

<Directory * >

Options all FollowSymLinks MultiViews ExecCGI -Indexes

AllowOverride all

</Directory>

RewriteEngine on
RewriteCond %{HTTP_HOST} !.*\..*\..*
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}$1 [QSA]

</VirtualHost>

Obviously, it doesn't work, since FastCgiExternalServer doesn't understand
%2.

How could I achieve that ?

Thanks in advance !

PS : this has been cross-posted to Server Fault
(http://serverfault.com/questions/577883/php-fpm-pool-selection-using-vhost-alias).

--

---
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.

New to nginx and PHP....502 Bad Gateway? (1 reply)

$
0
0
I just installed a fresh copy of Ubuntu 12.04.3 and updated it (on a local VM).

I installed nginx sucessfully.
ray@Web-Server:/etc/nginx/sites-available$ nginx -v
nginx version: nginx/1.4.5

I installed php5-cli and php5-fpm.
ray@Web-Server:/etc/nginx/sites-available$ php -v
PHP 5.3.10-1ubuntu3.10 with Suhosin-Patch (cli) (built: Feb 28 2014 23:14:25)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

I added the info.php file to /usr/share/nginx/html/info.php

I did the following:

cd /etc/nginx
sudo rm sites-enabled/default
sudo cp sites-available/default sites-available/my-default
sudo ln -s /etc/nginx/sites-available/my-default sites-enabled/default

my-default looks like this:

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

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

# Make site accessible from http://localhost/
server_name localhost;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

Everything else is commented out in the file.

So I was successful in browsing to the default nginx but now it is taking the same error as the info.php is?

Some of my "ps -A" output is:

906 tty4 00:00:00 getty
913 tty5 00:00:00 getty
920 tty2 00:00:00 getty
921 tty3 00:00:00 getty
923 tty6 00:00:00 getty
936 ? 00:00:00 acpid
937 ? 00:00:00 cron
938 ? 00:00:00 atd
948 ? 00:00:00 whoopsie
959 ? 00:00:00 php5-fpm
960 ? 00:00:00 php5-fpm
961 ? 00:00:00 php5-fpm
962 ? 00:00:00 php5-fpm
963 ? 00:00:00 php5-fpm
993 tty1 00:00:00 getty
998 ? 00:00:00 sshd
1139 ? 00:00:00 sshd
1140 pts/0 00:00:00 bash
1664 ? 00:00:00 nginx
1665 ? 00:00:00 nginx
1666 ? 00:00:00 nginx
1667 ? 00:00:00 nginx
1668 ? 00:00:00 nginx

/var/log/nginx/error.log =

2014/03/08 14:06:54 [crit] 1668#0: *29 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.122.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.122.241"

2014/03/08 14:07:02 [crit] 1668#0: *29 connect() to unix:/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.122.1, server: localhost, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "192.168.122.241"

From the Web Server, I can ping 192.168.122.1 just fine.

Ideas?

Thanks,

Ray

pool get unavailable (no replies)

$
0
0
Hello,

I'm using PHP FPM on Debian Squeeze with PHP 5.3.27. I have the following
pool configuration:

[bmde_prod]
listen = /var/lib/php5-sockets/bmde_prod.socket

pm = dynamic
pm.max_children = 250
pm.start_servers = 15
pm.min_spare_servers = 14
pm.max_spare_servers = 15
pm.max_requests = 1000

listen.backlog = -1

In normal operation, I have 16-20 pool processes running. From time to
time, the pool rises from 16-20 pool processes to maximum of 250 processes.
But there is no traffic from outside, after the limit of 250 is reached the
whole pool gets unavailable.


When I start a strace -n 3000 -f to all (250) running pool processes, I get
the following output:


[pid 20173] <... poll resumed> ) = 0 (Timeout)
[pid 20173] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 20173] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 19919] <... poll resumed> ) = 0 (Timeout)
[pid 19919] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 19919] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20186] <... poll resumed> ) = 0 (Timeout)
[pid 20186] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 20186] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 19973] <... poll resumed> ) = 0 (Timeout)
[pid 19973] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 19973] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20090] <... poll resumed> ) = 0 (Timeout)
[pid 20090] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 20090] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20548] <... poll resumed> ) = 0 (Timeout)
[pid 20548] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 20548] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20131] <... poll resumed> ) = 0 (Timeout)
[pid 20131] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 20131] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 19915] <... poll resumed> ) = 0 (Timeout)
[pid 19915] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 19915] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 19981] <... poll resumed> ) = 0 (Timeout)
[pid 19981] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 19981] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20364] <... poll resumed> ) = 0 (Timeout)
[pid 20364] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 20364] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20297] <... poll resumed> ) = 0 (Timeout)
[pid 20297] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 20297] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 19850] <... poll resumed> ) = 0 (Timeout)
[pid 19850] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 19850] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20395] <... poll resumed> ) = 0 (Timeout)
[pid 20395] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 20395] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20523] <... poll resumed> ) = 0 (Timeout)
[pid 20523] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 20523] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20422] <... poll resumed> ) = 0 (Timeout)
[pid 20422] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
[pid 20422] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20016] <... poll resumed> ) = 0 (Timeout)
[pid 19774] <... poll resumed> ) = 0 (Timeout)
[pid 20016] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0 <unfinished ...>
[pid 19774] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 0 <unfinished ...>
[pid 20016] <... poll resumed> ) = 0 (Timeout)
[pid 19774] <... poll resumed> ) = 0 (Timeout)
[pid 20016] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 19774] poll([{fd=9, events=POLLIN|POLLPRI}], 1, 1000 <unfinished ...>
[pid 20495] <... poll resumed> ) = 0 (Timeout)
[pid 20363] <... poll resumed> ) = 0 (Timeout)

.... and a lot more of the same lines.


If I kill one or two processes of the pool, the pool itself gets available
again and lowers the pool processes to normal operation.

Does anybody know that's about that?

Thanks,
Jonas

--

---
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/d/optout.

SIGKILL while performing lengthy task in shutdown function (no replies)

$
0
0
Hi,

we've seen the following happen a few times, and I'd like to know who is
sending the SIGKILL, and if I can do anything about that.

We run a lengthy update process in a shutdown function after the response
has been flushed with fastcgi_finish_request(). It usually takes 6-10s, but
under high load, it can take 40s or more. Sometimes, after roughly 30s (sometimes
more, sometimes less), the process performing the update receives a SIGKILL.
While we can usually recover from this (by simply restarting the update), the
SIGKILL may just hit us while we own the shared memory lock to update APC. This
lock is _not_ freed when the process dies, so that all further attempts to
access APC block.

In the PHP error_log, the typical order of events is:

[26-Feb-2014 15:02:01] update start (PID 27582)
[26-Feb-2014 15:02:01] WARNING: [pool php] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 48 total children
[26-Feb-2014 15:02:02] WARNING: [pool php] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 0 idle, and 53 total children
[...] more of the same

[26-Feb-2014 15:02:08] WARNING: [pool php] server reached pm.max_children setting (80), consider raising it
[26-Feb-2014 15:02:29] WARNING: [pool php] child 27582 exited on signal 9 (SIGKILL) after 103.188030 seconds from start


So, my question is, who is sending a SIGKILL to the process, why is
it done, and can I influence this behaviour in any way?

As far as I can tell, the SIGKILL is not caused by exceeding the
PHP max_execution_time (the overall CPU time used is smaller than
the configured limit) or the cpu time ulimit (set to unlimited).


thanks,


rainer

--

---
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/d/optout.

Odd memory graph (when php-fpm went crazy) Can someone explain what happened? (2 replies)

$
0
0
Hi, I recently had an outage with a VM that runs Ubuntu Linux 12.04 64bit
in an ESX Vmware environment. The php is 5.3 We've been having issues
with php-fpm needing to be restarted when the system becomes unusable. The
cacti graph of the memory of during the event is really confusing to me.

See attached. Can someone please tell me what the OS/Kernel/php-fpm was
doing that caused real memory to increase, cache memory to deplete, and
unused memory to increase? During this, we ran out of swap.

If anyone knows what went on, I would really appreciate it.

Please let me know if there is some other information you need. Simply
stopping and starting php-fpm fixed the issue. We suspect a poorly
writting app causing the usage and we are zeroing in on that, but any help
with understanding what happened would be wonderful.

Thanks!!

Pete

--

---
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/d/optout.

nginx + PHP-FPM via socket not performing better than apache !!! (no replies)

$
0
0
Hi,
I have been trying to setup nginx and fpm on our production machine.It already runs apache + mod-php and it serves around 50 Req/s with high memory usage but load average is below 1 on an 8 core 16GB machine.

I installed nginx + php-fpm via socket on this box and tried to put the same amount of traffic which apache bears with LVS but it accepts around 60-70 Req/sec only, if I try to increase it to 100 + the system load shoots and the php-fpm active processes reaches its limit and it stalls .

So is it intended to behave this way ? because what I have read on the forums/ blogs etc is that nginx with php-fpm outperforms apache.
I could be somethings wrong ,need suggestions and help to answer this question.


Thanks
Rajat

session handling bug (no replies)

$
0
0
I am developing an application on my localhost that uses Nginx/PHP5-fpm from Dotdeb (Linux Neptune 3.3), and have come across a bug in the handling of assignment of session_id() that doesn't occur under Apache/Lightspeed with PHP (on my host server).

This code:
session_id($date . '-' . $userid . '-' . $_SESSION['till']);

has to be modified to be:

$_SESSION['id']=($date . '-' . $userid . '-' . $_SESSION['till']);

and then use the $_SESSION['id'] instead of the true session_id().

The symptom is that the session is destroyed when going to the next page.

huge quantity of "Listen queue overflow: 193 already in queue awaiting acceptance" (no replies)

$
0
0
Hi all!
I change server, from an HP with 2 CPU Xeon quad core 8gb ram to a Dell with 2 CPU Xeon quad core and 16gb ram, both servers are with FreeBSD and I'm using same php-fpm and nginx configurations.

But I've a trouble about php-fpm, my log have a really huge of:
sonewconn: pcb 0xfffffe01f2c6f870: Listen queue overflow: 193 already in queue awaiting acceptance

I use PHP 5.3.28 with Suhosin-Patch

that's my php-fpm configuration:

[global]
pid = run/php-fpm.pid

error_log = /var/log/php-fpm/error.log
log_level = error

emergency_restart_threshold = 10
emergency_restart_interval = 1m

process_control_timeout = 10s
process.max = 0

[www]
user = www
group = www
security.limit_extensions = .php

listen = /tmp/php-fpm.$pool.sock
listen.allowed_clients = 127.0.0.1
listen.backlog = -1

pm = static
pm.max_children = 8
pm.max_requests = 10000000

request_slowlog_timeout = 40s
slowlog = /var/log/php-fpm/slow.$pool.log

env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp


Any idea?

--
RedFoxy Darrest
http://www.redfoxy.it


--

---
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/d/optout.

Struggling with php-fpm ERRORS (no replies)

$
0
0
There is this issue in the server that is not allowing me to run correctly
php-fpm, but despite this issue everything is running with a problem of 524
CloudFlare time out every time I SEND, POST ,etc

My server Configuration is: 12.04.4 LTS, Precise Pangolin + NGINX + ionCube
+ igBinary + CloudFlare (php-fpm)

Every time I try to start PHP-FPM I get stuck until I open a new session .

PHP-FPM LOG says this :

> [02-May-2014 02:51:05] ERROR: An another FPM instance seems to already
> > listen on /var/run/php5-fpm.sock
> >
> [02-May-2014 02:51:05] ERROR: FPM initialization failed


So far what I've investigate, with my short knowledge is that I have CGI
php.ini, PHP-FPM php.ini CLI php.ini

https://www.dropbox.com/s/nddqpmf0937x739/Screenshot%202014-05-02%2011.19.11.png

that maybe are in conflict

also php-fpm is correctly configured (Well that is what I think):
www.conf:

http://pastebin.com/QcTTBUEW

my NGNIX.conf is just the same that H5BP-NGINX Config provied
and my site-enable is:

server {
> # listen 80 deferred; # for Linux
> # listen 80 accept_filter=httpready; # for FreeBSD
> listen 80;
>
> # The host name to respond to
> server_name censocanino.com www.censocanino.com;
>
> # Path for static files
> root /sites/censocanino.com/public;
>
> # Try static files first, then php
> index index.html index.htm index.php;
>
> # Specific logs for this vhost
> access_log /sites/censocanino.com/log/log-access.log;
> error_log /sites/censocanino.com/log/log-error.log error;
>
> #Specify a charset
> charset utf-8;
>
> # Redirect needed to "hide" index.php
> location / {
> try_files $uri $uri/ /index.php?q=$uri&$args;
> }
>
> # Don't log robots.txt or favicon.ico files
> location ~* ^/(favicon.ico|robots.txt)$ {
> access_log off;
> log_not_found off;
> }
> # Custom 404 page
> error_page 404 /404.php;
>
> location ~*
> ^.+.(gif|jpg|jpeg|png|wmv|avi|mpg|mpeg|mp4|htm|html|js|css|mp3|swf|ico|flv|xml)
> {
> access_log off;
> expires 30d;
> }
>
> # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
> location ~ \.php$ {
> fastcgi_split_path_info ^(.+\.php)(/.+)$;
> # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
>
> # With php5-cgi alone:
> # fastcgi_pass 127.0.0.1:9000;
> # With php5-fpm:
> fastcgi_pass unix:/var/run/php5-fpm.sock;
> fastcgi_intercept_errors on;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> include fastcgi_params;
> }
>
> # Deny access to .htaccess
> location ~ /\.ht {
> deny all;
> }
>
> # PHPMYADMIN
> location /phpmyadmin {
> root /usr/share/;
> index index.php index.html index.htm;
> location ~ ^/phpmyadmin/(.+\.php)$ {
> try_files $uri =404;
> root /usr/share/;
> fastcgi_pass unix:/var/run/php5-fpm.sock;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> include fastcgi_params;
> }
> location ~*
> ^/phpmyadmin/(.+\.(jpeg|jpg|png|css|gif|ico|js|html|xml|txt))$ {
> root /usr/share/;
> }
> }
> location /phpMyAdmin {
> rewrite ^/* /phpmyadmin last;
> }
>
> # Include the basic h5bp config set
> include h5bp/basic.conf;
> }
>


More reference:

> `http://censocanino.com/phpinfo.php`


thanks


**EDIT**

I just notice that php-fpm.sock is 0kb

--

---
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/d/optout.

Does FPM in PHP 5.2. support statistics feature like PHP5.3.x+ (no replies)

$
0
0
HI all,
I want to ask how to use statistics feature in FPM in PHP5.2.x. I notice
that fpm in php5.2.x use the xml syntax. but when i add <value
name="status">/status</value> into fpm 's configuration file, it report
Warning, unknown setting 'status' in section '/configuration/workers/pool'


I have found the xml syntax example from here:
http://www.fatbsd.com/fpm/xml.html. and I add status setting like that, but
the fpm doesn't work.

I guess the fpm in php.5.2.x doesn't support statistics feature, right? is
anybody can tell me?

--

---
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/d/optout.

Sympa + Nginx errors (no replies)

$
0
0
Hello,
I'm quite new to Nginx, but so far i've had reasonable success in getting things to work, until I try and use the Sympa mailing list web interface.

With this config:

server {
listen 80;
server_name www.tld.co.uk;


location /static-sympa {
alias /var/lib/sympa/static_content;
}

location /sympa {
root /usr/lib/cgi-bin/sympa;
gzip off;
fastcgi_pass unix:/etc/php5/fpm/socks/www.tld.co.uk.sock;
fastcgi_split_path_info ^(/sympa)(.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param SCRIPT_FILENAME $document_root/wwsympa-wrapper.fcgi;
fastcgi_intercept_errors on;
}

And with this in the /etc/nginx/fastcgi_params file:

fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;


On trying to access www.tld.co.uk/sympa I get nothing at all in the Nginx error log, and the following in the Nginx access log:
<client IP> - - [18/May/2014:23:00:04 +0100] "GET /sympa HTTP/1.1" 200 6205 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36"

Even with php5-fpm configured for debug logging, nothing happens in the php5-fpm.log file either (and I can see that things do happen in this file for other Nginx web pages like postfixadmin or roundcube, so am reasonably confident that php5-fpm is correct).

What puzzles me most is that what gets posted to the clients web browser when visiting www.tld.co.uk/sympa is the following:

ELF????>?Ä?@@0?@8 @????@@@@@ø?ø????8?8?@8?@?????@@Œ?Œ? ??è è `è `X?`? ????`?`à?à????T?T?@T?@DD?Påtd?¨?¨?@¨?@,,?Qåtd??Råtd?è è `è `?????/lib64/ld-linux-x86-64.so.2???GNU??????GNUD?¬kV­´,û¯@©ècÞã‰Ø¡?????????????;?C?,?? 3?#???__gmon_start__libc.so.6setregidsetreuidexecvegetegidgeteuid__libc_start_mainGLIBC_2.2.5??????????u?i ?Uà?`???`????`????`????`?? ?`??(?`??Hƒì?è÷HƒÄ?Ãÿ5ê ÿ%ì ??@ÿ%ê héàÿÿÿÿ%â h?éÐÿÿÿÿ%Ú h?éÀÿÿÿÿ%Ò h?é°ÿÿÿÿ%Ê h?é ÿÿÿÿ% h?éÿÿÿATUH‰ÕSH‰óè‘ÿÿÿA‰Äè‰ÿÿÿD‰æ‰Çè¿ÿÿÿèªÿÿÿA‰Äè¢ÿÿÿD‰æ‰Çè¸ÿÿÿHÇ?€?@H‰ÞH‰ê[]A\¿€?@émÿÿÿ1íI‰Ñ^H‰âHƒäðPTIÇÀÐ?@HÇÁà?@HÇÇp?@è3ÿÿÿôHƒì?H‹?å H…Àt?ÿÐHƒÄ?А¸G?`UH-@?`Hƒø?H‰åw?]øH…Àtô]¿@?`ÿà??€¸@?`UH-@?`HÁø?H‰åH‰ÂHÁê?H?ÐH‰ÆHÑþu?]úH…Òtô]¿@?`ÿâ??€€=¹ u?UH‰åè~ÿÿÿ]Æ?¦ ?óÃ??@Hƒ=P? t?¸H…Àt?U¿ø `H‰åÿÐ]é{ÿÿÿévÿÿÿóÃfffff.??„H‰l$ØL‰d$àH-ÿ? L%ð? L‰l$èL‰t$ðL‰|$øH‰\$ÐHƒì8L)åA‰ýI‰öHÁý?I‰×èËýÿÿH…ít?1Û??@L‰úL‰öD‰ïAÿ?ÜHƒÃ?H9ërêH‹\$?H‹l$?L‹d$?L‹l$ L‹t$(L‹|$0HƒÄ8АHƒì?HƒÄ?Ã??/usr/lib/cgi-bin/sympa/wwsympa.fcgi???;,?XýÿÿHÈýÿÿp(ÿÿÿ 8ÿÿÿ¸??zR?x???????$??ýÿÿp??F??J??w?€??;*3$",DPýÿÿSB??Œ?A??†?D? ƒ???A??B???t€þÿÿ?$Œxþÿÿ‰QŒ?†?_?@Fƒ??Ž?? ?@€?@???ð?@ l?@?è `???ð `???˜?@õþÿoÐ?@?°?@?ð?@ a????è?`????`?@?H?@?? ?þÿÿo(?@ÿÿÿo?ðÿÿo??@?`??@&?@6?@F?@V?@f?@.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.jcr.dynamic.got.got.plt.data.bss???8?@8??????T?@T? ?!??t?@t?$?8??˜?@˜?4???4öÿÿo?Ð?@Ð????>??ð?@ð?À????F??°?@°?a?Nÿÿÿo???@??????[þÿÿo?(?@(? ???j??H?@H?????t??`?@`?? ??~??ð?@ð???y???@?p??„??p?@p?ü??Š??l?@l? ???x?@x?0?˜??¨?@¨?,?¦??Ø?@Ø?´?°??è `è ??¼??ð `ð ??È??ø `ø ??Í???`?à????Ö??à?`à????Û??è?`è?H??ä??0?`0???ê??@?`@?????@?ï?


I hope that somebody on this list can please help me understand what it is doing.

Many Thanks in advance!

Reducing the math on pm.start_servers' default value? (no replies)

$
0
0
Just noticed this small but funny thing when looking at my php-fpm.conf
file tonight:

; The number of child processes created on startup.
> ; Note: Used only when pm is set to 'dynamic'
> ; Default Value: min_spare_servers + (max_spare_servers -
> min_spare_servers) / 2
> ;pm.start_servers = 20
>

It seems to me like this equation:

min_spare_servers + (max_spare_servers - min_spare_servers) / 2
>

can actually be reduced to:

(min_spare_servers + max_spare_servers) / 2
>


Or am I missing something obvious?

--

---
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/d/optout.
Viewing all 219 articles
Browse latest View live