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: https://issues.apache.org/jira/browse/THRIFT-347 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: http://www.mail-archive.com/[email protected]/msg07089.html). However, this doesn't appear to have fixed the issue. So... what I have done is tweak TSocket.php as per: (look for // ADDED) http://pastebin.com/5m1nShtE And then tried out running our app with various timeouts set. This is the code that sets timeouts: http://pastebin.com/TXJAVVnt The results are: http://pastebin.com/5gWTPCHd 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. Thanks Dave
