You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by ruslan usifov <ru...@gmail.com> on 2011/02/17 11:37:55 UTC

cassandra & php

Hello


If anybody use cassandra throw php, please share you experience. How you
solve problem with thrift_protocol which have tons of bugs (memleaks,
impossible pass long time stamps, wrong work with ZTS, hung when work with
framed transport)

And did you sufficient with php -> Cassandra performance

Re: cassandra & php

Posted by ruslan usifov <ru...@gmail.com>.
You main system is 64 or 32 bit?

Re: cassandra & php

Posted by Sasha Dolgy <sd...@gmail.com>.
I am having no problems using thobbs fork of phpcassa.  Works a treat.
On 17 Feb 2011 11:38, "ruslan usifov" <ru...@gmail.com> wrote:
> Hello
>
>
> If anybody use cassandra throw php, please share you experience. How you
> solve problem with thrift_protocol which have tons of bugs (memleaks,
> impossible pass long time stamps, wrong work with ZTS, hung when work with
> framed transport)
>
> And did you sufficient with php -> Cassandra performance

RE: cassandra & php

Posted by David Quattlebaum <dq...@medprocure.com>.
John,

 

Just wondering what you are using if not phpcassa?

 

Thanks!

 

David

 

From: John Lennard [mailto:john@gravitate.co.nz] 
Sent: Thursday, February 17, 2011 6:41 PM
To: user@cassandra.apache.org
Subject: Re: cassandra & php

 

Hi,

 

How does this connection pooling fit in with the  TSocketPool.php
classes? Or am I off the wicket here?

 

These are just a few of my observations in relation to what i have seen
so far when working with PHP and Cassandra. I have been working with
cassandra / php for the last 8 months now in a project, and while not
using phpcassa, it strikes me that the Thrift layer in php may need some
energy directed at it. Reads in particular do seem noticeably slow and i
am not sure if this is tied in with the php socket implementation, how
my test cluster is currently set up or how i am currently working with
and structuring my data. I also wonder if there are other aspects of the
thrift layer that could pushed into a native module as there is still
seems to be lots  php code present in the thrift classes.

 

Another observation I have made during this work is that xdebug has a
significant effect on performance, which can make profiling a little
more challenging.

 

 

 

Regards

John

 

 

 

On 18/02/2011, at 10:49 AM, Tyler Hobbs wrote:





	what i'm not entirely happy with in using php versus java/hector
is that there isn't any connection pooling.  maybe that's just me and my
poor skills.  


Better connection pooling and failover are on the way.  You can check on
the progress in the connection-pooling branch here:
https://github.com/thobbs/phpcassa/tree/connection-pooling

I just haven't had time to wrap it up lately, but it should be done
soon.

-- 
Tyler Hobbs
Software Engineer, DataStax <http://datastax.com/> 
Maintainer of the pycassa <http://github.com/pycassa/pycassa>  Cassandra
Python client library

 


Re: cassandra & php

Posted by Tyler Hobbs <ty...@datastax.com>.
>
> How does this connection pooling fit in with the  TSocketPool.php classes?
> Or am I off the wicket here?
>

Right now, TSocketPool is not being used (in pycassa or phpcassa);
individual TSockets are managed within the library.  TSocketPool may be a
good alternative to this in the future, but I haven't investigated this
fully yet.


> These are just a few of my observations in relation to what i have seen so
> far when working with PHP and Cassandra. I have been working with cassandra
> / php for the last 8 months now in a project, and while not using phpcassa,
> it strikes me that the Thrift layer in php may need some energy directed at
> it. Reads in particular do seem noticeably slow and i am not sure if this is
> tied in with the php socket implementation, how my test cluster is currently
> set up or how i am currently working with and structuring my data.
>

I've noticed this as well for large reads (multigets, in particular).  It
seems to be a cache issue, as latter portions of the frame are processed
much more quickly.  I observed this using the C extension, for what it's
worth.


> I also wonder if there are other aspects of the thrift layer that could
> pushed into a native module as there is still seems to be lots  php code
> present in the thrift classes.
>

Presumably so, and I think it would be great if anybody could tackle this.
I have a feeling that the existing C code needs some looking over.  I've
seen and tried to fix a few bugs there recently, but it wouldn't surprise me
at all if there were some inefficiencies there.


> Another observation I have made during this work is that xdebug has a
> significant effect on performance, which can make profiling a little more
> challenging.
>

Manual time collections worked pretty well for my purposes (a long loop of
the same operation).

-- 
Tyler Hobbs
Software Engineer, DataStax <http://datastax.com/>
Maintainer of the pycassa <http://github.com/pycassa/pycassa> Cassandra
Python client library

Re: cassandra & php

Posted by John Lennard <jo...@gravitate.co.nz>.
Hi,

How does this connection pooling fit in with the  TSocketPool.php classes? Or am I off the wicket here?

These are just a few of my observations in relation to what i have seen so far when working with PHP and Cassandra. I have been working with cassandra / php for the last 8 months now in a project, and while not using phpcassa, it strikes me that the Thrift layer in php may need some energy directed at it. Reads in particular do seem noticeably slow and i am not sure if this is tied in with the php socket implementation, how my test cluster is currently set up or how i am currently working with and structuring my data. I also wonder if there are other aspects of the thrift layer that could pushed into a native module as there is still seems to be lots  php code present in the thrift classes.

Another observation I have made during this work is that xdebug has a significant effect on performance, which can make profiling a little more challenging.



Regards
John



On 18/02/2011, at 10:49 AM, Tyler Hobbs wrote:

> what i'm not entirely happy with in using php versus java/hector is that there isn't any connection pooling.  maybe that's just me and my poor skills. 
> 
> Better connection pooling and failover are on the way.  You can check on the progress in the connection-pooling branch here: https://github.com/thobbs/phpcassa/tree/connection-pooling
> 
> I just haven't had time to wrap it up lately, but it should be done soon.
> 
> -- 
> Tyler Hobbs
> Software Engineer, DataStax
> Maintainer of the pycassa Cassandra Python client library
> 


Re: cassandra & php

Posted by Sasha Dolgy <sd...@gmail.com>.
eager to test!  thanks tyler ...

On Thu, Feb 17, 2011 at 10:49 PM, Tyler Hobbs <ty...@datastax.com> wrote:

> what i'm not entirely happy with in using php versus java/hector is that
>> there isn't any connection pooling.  maybe that's just me and my poor
>> skills.
>>
>
> Better connection pooling and failover are on the way.  You can check on
> the progress in the connection-pooling branch here:
> https://github.com/thobbs/phpcassa/tree/connection-pooling
>
> I just haven't had time to wrap it up lately, but it should be done soon.
>

Re: cassandra & php

Posted by Tyler Hobbs <ty...@datastax.com>.
>
> what i'm not entirely happy with in using php versus java/hector is that
> there isn't any connection pooling.  maybe that's just me and my poor
> skills.
>

Better connection pooling and failover are on the way.  You can check on the
progress in the connection-pooling branch here:
https://github.com/thobbs/phpcassa/tree/connection-pooling

I just haven't had time to wrap it up lately, but it should be done soon.

-- 
Tyler Hobbs
Software Engineer, DataStax <http://datastax.com/>
Maintainer of the pycassa <http://github.com/pycassa/pycassa> Cassandra
Python client library

Re: cassandra & php

Posted by Sasha Dolgy <sd...@gmail.com>.
i think the quesiton you started out with was about using php & cassandra.
the underlying cassandra configuration and implementation shouldn't change
if you decide to go with pycassa, hector or phpcassa ... the thrift
interface is suitably abstracted by these...

what i'm not entirely happy with in using php versus java/hector is that
there isn't any connection pooling.  maybe that's just me and my poor
skills.

how large or small my cassandra instances are and the configuration of
cassandra are entirely unrelated to the tier that sits above thrift.  that's
my feeling....

-sd


On Thu, Feb 17, 2011 at 2:24 PM, ruslan usifov <ru...@gmail.com>wrote:

>
>
> 2011/2/17 Sasha Dolgy <sd...@gmail.com>
>
>> Developing on win7 w/single cassandra node.  Deployed to aws large
>> instances for cassandra and micro for web, micro for php....
>>
>> In production how many instances for cassandra do you use? And is it
> possible to provide your cassandra config?
>

Re: cassandra & php

Posted by ruslan usifov <ru...@gmail.com>.
2011/2/17 Sasha Dolgy <sd...@gmail.com>

> Developing on win7 w/single cassandra node.  Deployed to aws large
> instances for cassandra and micro for web, micro for php....
>
> In production how many instances for cassandra do you use? And is it
possible to provide your cassandra config?

Re: cassandra & php

Posted by Sasha Dolgy <sd...@gmail.com>.
Developing on win7 w/single cassandra node.  Deployed to aws large instances
for cassandra and micro for web, micro for php....
On 17 Feb 2011 13:36, "ruslan usifov" <ru...@gmail.com> wrote:
> And how many nodes of cassandra do you use?
>
> 2011/2/17 ruslan usifov <ru...@gmail.com>
>
>> Hello
>>
>>
>> If anybody use cassandra throw php, please share you experience. How you
>> solve problem with thrift_protocol which have tons of bugs (memleaks,
>> impossible pass long time stamps, wrong work with ZTS, hung when work
with
>> framed transport)
>>
>> And did you sufficient with php -> Cassandra performance
>>
>>

Re: cassandra & php

Posted by ruslan usifov <ru...@gmail.com>.
And how many nodes of cassandra do you use?

2011/2/17 ruslan usifov <ru...@gmail.com>

> Hello
>
>
> If anybody use cassandra throw php, please share you experience. How you
> solve problem with thrift_protocol which have tons of bugs (memleaks,
> impossible pass long time stamps, wrong work with ZTS, hung when work with
> framed transport)
>
> And did you sufficient with php -> Cassandra performance
>
>