Mailing List Archive

504 Gateway Timeout on Debian Squeeze
Hi -

I am getting this frequently and I do not know if it is Cherokee, or my
server resources. I am fairly new to sysadmining.

I am running a Debian Squeeze box w/ cherokee php5-cgi and a few other
things that allow me to build Drupal sites.

Is this a result of misconfiguration of php or cherokee or insufficient
server resources?

Thank you kindly and greetings to all.

-- Hans
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: 504 Gateway Timeout on Debian Squeeze [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Op 13-11-11 20:29, hans@netupgrades.com schreef:
> Is this a result of misconfiguration of php or cherokee or
> insufficient server resources?

Most likely to few CHILDREN processes, you could also migrate to php-fpm.


Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEAREKAAYFAk7AHy8ACgkQYH1+F2Rqwn0+4gCfUWHUzIjzEEA9vz11jTH9VgUy
PAUAnjEasm9YeSLKRQnbebSTtTzqQBOH
=Qofi
-----END PGP SIGNATURE-----
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: 504 Gateway Timeout on Debian Squeeze [ In reply to ]
Thank you Stefan,

Is there a way to work with the existing php5-cgi? by adding more
children processes?

Are these php children process or Cherokee children processes you are
referring to?

I am not sure I have the skill to manage a migration, and thus I ask if
upping server resources would also end these timeouts?

Who/what is timing out? Where can I find more info?

Thank you much again, Stefan! :0) --Hans


On Sun, 13 Nov 2011 20:49:03 +0100
Stefan de Konink <stefan@konink.de> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Op 13-11-11 20:29, hans@netupgrades.com schreef:
> > Is this a result of misconfiguration of php or cherokee or
> > insufficient server resources?
>
> Most likely to few CHILDREN processes, you could also migrate to
> php-fpm.
>
>
> Stefan
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.18 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEAREKAAYFAk7AHy8ACgkQYH1+F2Rqwn0+4gCfUWHUzIjzEEA9vz11jTH9VgUy
> PAUAnjEasm9YeSLKRQnbebSTtTzqQBOH
> =Qofi
> -----END PGP SIGNATURE-----
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee

_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: 504 Gateway Timeout on Debian Squeeze [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Op 13-11-11 20:55, hans@netupgrades.com schreef:
> Are these php children process or Cherokee children processes you
> are referring to?

No, go to the sources page, then php. Then you see what CHILDREN
variable I mean.


Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEAREKAAYFAk7AISAACgkQYH1+F2Rqwn1GFgCfeDyEJ34ZPqxHUryn2YPMzKXe
DTwAn2hHNdyQSOm9RyL8FHS88eS1JHxY
=PgWn
-----END PGP SIGNATURE-----
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: 504 Gateway Timeout on Debian Squeeze [ In reply to ]
Hi and big thanks! :)

I have increased Spawning timeout to 10 already and have set
PHP_FCGI_CHILDREN to 15 (and fyi - before migrating to php-fpm I am
still am getting 504 on the Cherokee admin pages -- I am on a Linode
w/ 512 RAM).

Below is how I understand to migrate to php-fpm, please comment.

On Sun, 13 Nov 2011 20:49:03 +0100
Stefan de Konink <stefan@konink.de> wrote:

> Op 13-11-11 20:29, hans@netupgrades.com schreef:
> > Is this a result of misconfiguration of php or cherokee or
> > insufficient server resources?
>
> Most likely to few CHILDREN processes, you could also migrate to
> php-fpm.

I appreciate the guidance, thank you Stefan.

I would like to migrate to php-fpm as you suggest.

I think this is the way to migrate. Please advise if correct/incorrect.

Tips garnished from Daniel Lo Nigro here:

http://lists.octality.com/pipermail/cherokee/2011-November/015200.html

On Debian Squeeze:

apt-get install php-fpm

Once installed run:

/etc/init.d/php5-fpm start

"get Cherokee to use its port (which is port 9000 by default)."

This part I do not know where to edit the config.

"Set the "interpreter" in the Cherokee configuration to "false" as it's
no longer needed (php-fpm handles the spawning)."

Set the Interpreter field to empty? i.e. remove:

/usr/bin/php-cgi -b 127.0.0.1:47990

After making the correct changes above, Graceful restart and done?

Is this a correct way to migrate to php-fpm?

Thank you all kindly, again. --Hans

> Stefan
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.18 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEAREKAAYFAk7AHy8ACgkQYH1+F2Rqwn0+4gCfUWHUzIjzEEA9vz11jTH9VgUy
> PAUAnjEasm9YeSLKRQnbebSTtTzqQBOH
> =Qofi
> -----END PGP SIGNATURE-----
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee

_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: 504 Gateway Timeout on Debian Squeeze [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Op 14-11-11 03:41, hans@netupgrades.com schreef:
> Hi and big thanks! :)
>
> I have increased Spawning timeout to 10 already and have set
> PHP_FCGI_CHILDREN to 15 (and fyi - before migrating to php-fpm I
> am still am getting 504 on the Cherokee admin pages -- I am on a
> Linode w/ 512 RAM).

15 here means: 15 users can concurrently use PHP. So if 15 users use a
heavy search function on your site. The 16th has to wait and might get
a timeout.

php-fpm can 'theoretically' scale the amount of children dynamically,
but can't get you the magic memory for it. And with PHP you will need
memory.

It is also possible that your php script is just to slow (for example
takes longer than 15 seconds to compute). This will also result it
issues. This is another timeout, you can find it in the FastCGI
handler setting go to Tab Restrictions. You might increase that, but
keep it below the network timeout. (Found in General: Timout)


> Is this a correct way to migrate to php-fpm?

No clue, but it looks ok.


Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEAREKAAYFAk7Ag4wACgkQYH1+F2Rqwn30+QCffVWpe4uOTS4WWh6iH+Ws5QCU
3rEAn2/Lhtuff1c9nkhzXpS/QEGMQWfB
=2KNE
-----END PGP SIGNATURE-----
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: 504 Gateway Timeout on Debian Squeeze [ In reply to ]
Okay big thanks again, Stefan.

I changed the Network timeout to 125 and the FastCGI to 120.

I also upped my Linode to 1GB ram.

Im running aggregators on Drupal and sometimes they take a long time to
finish. I will hold off on the php-fpm until things occur again.

Much fine appreciation for this assistance! Thank you! --Hans

On Mon, 14 Nov 2011 03:57:17 +0100
Stefan de Konink <stefan@konink.de> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> Op 14-11-11 03:41, hans@netupgrades.com schreef:
> > Hi and big thanks! :)
> >
> > I have increased Spawning timeout to 10 already and have set
> > PHP_FCGI_CHILDREN to 15 (and fyi - before migrating to php-fpm I
> > am still am getting 504 on the Cherokee admin pages -- I am on a
> > Linode w/ 512 RAM).
>
> 15 here means: 15 users can concurrently use PHP. So if 15 users use a
> heavy search function on your site. The 16th has to wait and might get
> a timeout.
>
> php-fpm can 'theoretically' scale the amount of children dynamically,
> but can't get you the magic memory for it. And with PHP you will need
> memory.
>
> It is also possible that your php script is just to slow (for example
> takes longer than 15 seconds to compute). This will also result it
> issues. This is another timeout, you can find it in the FastCGI
> handler setting go to Tab Restrictions. You might increase that, but
> keep it below the network timeout. (Found in General: Timout)
>
>
> > Is this a correct way to migrate to php-fpm?
>
> No clue, but it looks ok.
>
>
> Stefan
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.18 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEAREKAAYFAk7Ag4wACgkQYH1+F2Rqwn30+QCffVWpe4uOTS4WWh6iH+Ws5QCU
> 3rEAn2/Lhtuff1c9nkhzXpS/QEGMQWfB
> =2KNE
> -----END PGP SIGNATURE-----

_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: 504 Gateway Timeout on Debian Squeeze [ In reply to ]
On Mon, Nov 14, 2011 at 1:41 PM, <hans@netupgrades.com> wrote:
>
>
> "get Cherokee to use its port (which is port 9000 by default)."
>
> This part I do not know where to edit the config.
>
> "Set the "interpreter" in the Cherokee configuration to "false" as it's
> no longer needed (php-fpm handles the spawning)."
>
> Set the Interpreter field to empty? i.e. remove:
>
> /usr/bin/php-cgi -b 127.0.0.1:47990
>
> After making the correct changes above, Graceful restart and done?
>
> Is this a correct way to migrate to php-fpm?


The configuration is on the "Sources" page in Cherokee Admin. Here is a
screenshot of my configuration: http://ss.dan.cx/2011/11/14-20.27.26.png .
php-fpm needs barely any configuration, as most of the hard work (spawning
the processes) is moved out into the php-fpm daemon. All Cherokee needs to
know is the port number to connect to, the rest of the settings can be left
blank.

php-fpm doesn't need the interpreter field set as it handles spawning
itself. However, Cherokee didn't let me make the interpreter blank (shows a
"Cannot be blank" error), so I just set it to "false".






> Thank you all kindly, again. --Hans
>
> > Stefan
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v2.0.18 (GNU/Linux)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> >
> > iEYEAREKAAYFAk7AHy8ACgkQYH1+F2Rqwn0+4gCfUWHUzIjzEEA9vz11jTH9VgUy
> > PAUAnjEasm9YeSLKRQnbebSTtTzqQBOH
> > =Qofi
> > -----END PGP SIGNATURE-----
> > _______________________________________________
> > Cherokee mailing list
> > Cherokee@lists.octality.com
> > http://lists.octality.com/listinfo/cherokee
>
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee
>
Re: 504 Gateway Timeout on Debian Squeeze [ In reply to ]
On Mon, 14 Nov 2011, Daniel Lo Nigro wrote:

> php-fpm doesn't need the interpreter field set as it handles spawning itself. However, Cherokee didn't let me make the interpreter blank (shows a
> "Cannot be blank" error), so I just set it to "false".

Then set 'host' instead of 'interpreter' :)

Stefan
Re: 504 Gateway Timeout on Debian Squeeze [ In reply to ]
On Mon, 14 Nov 2011 20:31:30 +1100
Daniel Lo Nigro <lists@dan.cx> wrote:

> On Mon, Nov 14, 2011 at 1:41 PM, <hans@netupgrades.com> wrote:
> >
> >
> > "get Cherokee to use its port (which is port 9000 by default)."
> >
> > This part I do not know where to edit the config.
> >
> > "Set the "interpreter" in the Cherokee configuration to "false" as
> > it's no longer needed (php-fpm handles the spawning)."
> >
> > Set the Interpreter field to empty? i.e. remove:
> >
> > /usr/bin/php-cgi -b 127.0.0.1:47990
> >
> > After making the correct changes above, Graceful restart and done?
> >
> > Is this a correct way to migrate to php-fpm?
>
>
> The configuration is on the "Sources" page in Cherokee Admin. Here is
> a screenshot of my configuration:
> http://ss.dan.cx/2011/11/14-20.27.26.png . php-fpm needs barely any
> configuration, as most of the hard work (spawning the processes) is
> moved out into the php-fpm daemon. All Cherokee needs to know is the
> port number to connect to, the rest of the settings can be left blank.
>
> php-fpm doesn't need the interpreter field set as it handles spawning
> itself. However, Cherokee didn't let me make the interpreter blank
> (shows a "Cannot be blank" error), so I just set it to "false".

Okay - Thank you Daniel for this further explanation.

I now see that php-fpm is *not* in squeeze, however, it *is* is wheezy,
so I will wait until wheezy is stable and then install php-fpm. (I do
not want to pull from dotdeb.)

I will report back with results at that time.

Thanks to all, once again. :0) -Hans

> >
> > > Stefan
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v2.0.18 (GNU/Linux)
> > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> > >
> > > iEYEAREKAAYFAk7AHy8ACgkQYH1+F2Rqwn0+4gCfUWHUzIjzEEA9vz11jTH9VgUy
> > > PAUAnjEasm9YeSLKRQnbebSTtTzqQBOH
> > > =Qofi
> > > -----END PGP SIGNATURE-----
> > > _______________________________________________
> > > Cherokee mailing list
> > > Cherokee@lists.octality.com
> > > http://lists.octality.com/listinfo/cherokee
> >
> > _______________________________________________
> > Cherokee mailing list
> > Cherokee@lists.octality.com
> > http://lists.octality.com/listinfo/cherokee
> >

_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: 504 Gateway Timeout on Debian Squeeze [ In reply to ]
On Mon, Nov 14, 2011 at 8:32 PM, Stefan de Konink <stefan@konink.de> wrote:

> On Mon, 14 Nov 2011, Daniel Lo Nigro wrote:
>
> php-fpm doesn't need the interpreter field set as it handles spawning
>> itself. However, Cherokee didn't let me make the interpreter blank (shows a
>> "Cannot be blank" error), so I just set it to "false".
>>
>
> Then set 'host' instead of 'interpreter' :)
>
> Oh, hahahaha, I can't believe I missed that. Thanks for that.

(now I feel stupid for noticing that!)