thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Gardner <>
Subject Thrift via PHP timeout issues
Date Wed, 09 Feb 2011 10:41:35 GMT
Hi all

I remember coming across a Thrift issue with PHP ages ago, whilst reading
data from Cassandra. The problem was that if the amount of data returned
(eg: in bytes) was over a certain threshold, it would always take an amount
of time exactly equal to the socket timeout to receive the data. If the
amount was below this threshold, it would take very little time at all.  I
don't remember why we never got to the bottom of the issue at that time, but
today it is causing me issues again.

I had a look through Jira and found this, which sounds like the problem:

I then downloaded Thrift 0.6.0 yesterday, downloaded the Cassandra 0.6.6
Thrift interface and then built the PHP API from interface (after tweaking
as per this message:

However, this doesn't appear to have fixed the issue.

So... what I have done is tweak TSocket.php as per: (look for // ADDED)

And then tried out running our app with various timeouts set. This is the
code that sets timeouts:

The results are:

Things to note:

 - More Cassandra reads than listed here happen; however those returning
less data will happen very quickly
 - It would be handy if the generated PHP files contained the version of
Thrift they were built from within the header; currently it can be tricky to
be certain that you have the right files

So it seems as thought fread() is having issues. I was wondering if anyone
else had experienced this? Is it a problem with the server (eg: Cassandra
0.6.6) or is it a problem with the Thrift TSocket.php code?

Any help appreciated.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message