You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(6) |
Nov
(8) |
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(19) |
Feb
(15) |
Mar
(10) |
Apr
(8) |
May
(7) |
Jun
(9) |
Jul
(13) |
Aug
(31) |
Sep
(111) |
Oct
(52) |
Nov
(72) |
Dec
(42) |
| 2006 |
Jan
(21) |
Feb
(32) |
Mar
(33) |
Apr
(24) |
May
(15) |
Jun
(40) |
Jul
(32) |
Aug
(19) |
Sep
(38) |
Oct
(37) |
Nov
(63) |
Dec
(37) |
| 2007 |
Jan
(18) |
Feb
(39) |
Mar
(69) |
Apr
(49) |
May
(71) |
Jun
(59) |
Jul
(71) |
Aug
(85) |
Sep
(46) |
Oct
(14) |
Nov
(25) |
Dec
(56) |
| 2008 |
Jan
(24) |
Feb
(77) |
Mar
(104) |
Apr
(44) |
May
(41) |
Jun
(11) |
Jul
(31) |
Aug
(59) |
Sep
(44) |
Oct
(86) |
Nov
(66) |
Dec
(93) |
| 2009 |
Jan
(88) |
Feb
(41) |
Mar
(49) |
Apr
(135) |
May
(22) |
Jun
(31) |
Jul
(60) |
Aug
(71) |
Sep
(76) |
Oct
(18) |
Nov
(52) |
Dec
(20) |
| 2010 |
Jan
(8) |
Feb
(50) |
Mar
(35) |
Apr
(48) |
May
(46) |
Jun
(84) |
Jul
(38) |
Aug
(61) |
Sep
(51) |
Oct
(31) |
Nov
(17) |
Dec
(18) |
| 2011 |
Jan
(51) |
Feb
(14) |
Mar
(17) |
Apr
(23) |
May
(15) |
Jun
(11) |
Jul
(5) |
Aug
(5) |
Sep
(15) |
Oct
(8) |
Nov
(5) |
Dec
(25) |
| 2012 |
Jan
(2) |
Feb
(4) |
Mar
(6) |
Apr
(9) |
May
(27) |
Jun
(32) |
Jul
(36) |
Aug
(10) |
Sep
(16) |
Oct
(3) |
Nov
(13) |
Dec
(7) |
| 2013 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(4) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(9) |
Jul
(5) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(3) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
(6) |
Feb
|
Mar
|
Apr
(10) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2018 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
|
2
|
3
|
4
|
|
5
|
6
(12) |
7
(5) |
8
(6) |
9
(1) |
10
(1) |
11
(4) |
|
12
(2) |
13
(7) |
14
|
15
(1) |
16
(1) |
17
(2) |
18
(2) |
|
19
(1) |
20
(2) |
21
(1) |
22
(4) |
23
|
24
(9) |
25
(5) |
|
26
(4) |
27
(2) |
28
(2) |
29
(1) |
30
(11) |
31
|
|
|
From: <php...@li...> - 2008-10-22 07:54:46
|
Hi,
> even using fflush to try
> and force it to send a packet.) Jost, do you have some PHP code that
> can reproduce this bug?
Are you sure. We use fflush() to send out the header immediately so that the back-end can set up the ContextRunner.
I am sure that this worked.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2008-10-22 07:37:47
|
Hi,
it is true that PHP buffers data internally. But as soon as read() is called on the same stream, the outgoing data is flushed. The problem is really the "ack delay" caused by BSD's socket implementation.
I suggest to discuss this on the BSD or PHP mailing list, as this affects all PHP applications running on BSD, not only the PHP/Java Bridge.
Regards,
Jost Boekemeier
|
|
From: <php...@li...> - 2008-10-22 04:57:24
|
Sorry, seems my attachments were stripped. Files available at: http://vanstaveren.us/~trick/fbsd-nagle-localhost-errorcase/ Cheers, Patrick php...@li... wrote: > [Sorry to hijack this thread, just replying from a proper email > account as my @mintel.com account is using Lotus Notes] > > Alright, I've made some good progress here in understanding this bug: > > * Grabbed & compiled the test code as on the FreeBSD ML. Bug > reproduced. Also produced a client fix within the java code using > Socket::setTcpNoDelay(true) to bypass Nagle's Algorithm and it proves > that this is the socket option that is not being automatically set. > * Split out the test code into two pieces: a java server which listens > for the packet [TestServ.class], java code to act as a client > [TestClient.class] and PHP code which does the client end. I ended up > with two PHP implementations in an attempt to reproduce the bug: > One) which uses fsockopen(...) which is the same socket method that > PJB's PHP library uses. I cannot get this to trigger Nagle's > Algorithm. Inspection using tcpdump shows that the socket created > with fsockopen is buffered, so two calls to fwrite (one with a single > byte, one with 50 bytes) end up in a single packet as it waits to send > data until the socket is closed. Code attached [fsockopen-client.php] > Two) which uses the socket_* functions in the PHP Socket extension and > a hacky call to socket_set_option to shrink the send buffer size to 1 > before the first packet ("@") and then expand the buffer size to 51 > bytes for the second packet. tcpdump inspection shows that it doesn't > produce the exact same size packets as the java code, but it > definitely triggers Nagle's Algorithm and the slowdown is roughly the > same as the java test client. Code attached [sockets-client.php] > > From there, I sought out to set TCP_NODELAY in PHP: > * Took a look around the PHP source code in ext/sockets/sockets.c:500+ > where the socket options are set. The PHP constants are [naturally] > the same value as whatever the local system has defined for the > kernel's integer value of the constant. TCP_NODELAY on FreeBSD is > 0x01. I added a function call to my sockets-client.php before sending > a packet like: > socket_set_option($sock, SOL_TCP, 0x01, 1); // disable Nagle's Algorithm > ...and it works like a charm. Performs like it should. > * I've patched sockets.c in PHP and recompiled, and now have > TCP_NODELAY available in my sockets extension. Am submitting this > patch to PHP for inclusion. Can now do: > socket_set_option($sock, SOL_TCP, TCP_NODELAY, 1); // disable Nagle's > Algorithm > ...and again, works like a charm. > > Importantly, from the PJB angle: I cannot reproduce the bug with > Nagle's Algorithm using the fsockopen socket method (even using fflush > to try and force it to send a packet.) Jost, do you have some PHP > code that can reproduce this bug? I'm really curious. I'm tempted to > say that the buffering used by fsockopen will dodge this bug, but I > don't know for sure. I'm also wondering if the buffering used by > fsockopen might actually be incurring an unnecessary (albeit minor) > performance penalty on PJB and if the sockets functions might be a > wiser choice. I'm no expert here. > > The patch I've written to make TCP_NODELAY available in PHP will fix > the bug if we're ever communicating using the sockets extension, but > we're using fsockopen. It's still worth a submit as it might be > useful. I don't know anything about the internals of fsockopen (I'll > give the code a read.) Furthermore there's no method that I can see > to set socket options on a stream opened by fsockopen. > > Sorry if this is a lot to digest. Let me know what your thoughts are > and most importantly, if you have a way to reproduce this bug using > fsockopen in PHP (and thus something that will actually affect PJB.) > > Thanks for all your help! > > Patrick > > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > ------------------------------------------------------------------------ > > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > -- Patrick "Trick" van Staveren http://trick.vanstaveren.us |
|
From: <php...@li...> - 2008-10-22 02:53:35
|
[Sorry to hijack this thread, just replying from a proper email account
as my @mintel.com account is using Lotus Notes]
Alright, I've made some good progress here in understanding this bug:
* Grabbed & compiled the test code as on the FreeBSD ML. Bug
reproduced. Also produced a client fix within the java code using
Socket::setTcpNoDelay(true) to bypass Nagle's Algorithm and it proves
that this is the socket option that is not being automatically set.
* Split out the test code into two pieces: a java server which listens
for the packet [TestServ.class], java code to act as a client
[TestClient.class] and PHP code which does the client end. I ended up
with two PHP implementations in an attempt to reproduce the bug:
One) which uses fsockopen(...) which is the same socket method that
PJB's PHP library uses. I cannot get this to trigger Nagle's
Algorithm. Inspection using tcpdump shows that the socket created with
fsockopen is buffered, so two calls to fwrite (one with a single byte,
one with 50 bytes) end up in a single packet as it waits to send data
until the socket is closed. Code attached [fsockopen-client.php]
Two) which uses the socket_* functions in the PHP Socket extension and a
hacky call to socket_set_option to shrink the send buffer size to 1
before the first packet ("@") and then expand the buffer size to 51
bytes for the second packet. tcpdump inspection shows that it doesn't
produce the exact same size packets as the java code, but it definitely
triggers Nagle's Algorithm and the slowdown is roughly the same as the
java test client. Code attached [sockets-client.php]
From there, I sought out to set TCP_NODELAY in PHP:
* Took a look around the PHP source code in ext/sockets/sockets.c:500+
where the socket options are set. The PHP constants are [naturally] the
same value as whatever the local system has defined for the kernel's
integer value of the constant. TCP_NODELAY on FreeBSD is 0x01. I added
a function call to my sockets-client.php before sending a packet like:
socket_set_option($sock, SOL_TCP, 0x01, 1); // disable Nagle's Algorithm
...and it works like a charm. Performs like it should.
* I've patched sockets.c in PHP and recompiled, and now have TCP_NODELAY
available in my sockets extension. Am submitting this patch to PHP for
inclusion. Can now do:
socket_set_option($sock, SOL_TCP, TCP_NODELAY, 1); // disable Nagle's
Algorithm
...and again, works like a charm.
Importantly, from the PJB angle: I cannot reproduce the bug with Nagle's
Algorithm using the fsockopen socket method (even using fflush to try
and force it to send a packet.) Jost, do you have some PHP code that
can reproduce this bug? I'm really curious. I'm tempted to say that
the buffering used by fsockopen will dodge this bug, but I don't know
for sure. I'm also wondering if the buffering used by fsockopen might
actually be incurring an unnecessary (albeit minor) performance penalty
on PJB and if the sockets functions might be a wiser choice. I'm no
expert here.
The patch I've written to make TCP_NODELAY available in PHP will fix the
bug if we're ever communicating using the sockets extension, but we're
using fsockopen. It's still worth a submit as it might be useful. I
don't know anything about the internals of fsockopen (I'll give the code
a read.) Furthermore there's no method that I can see to set socket
options on a stream opened by fsockopen.
Sorry if this is a lot to digest. Let me know what your thoughts are
and most importantly, if you have a way to reproduce this bug using
fsockopen in PHP (and thus something that will actually affect PJB.)
Thanks for all your help!
Patrick
--
Patrick "Trick" van Staveren
http://trick.vanstaveren.us
|