I have read all these articles about how fast cassandra can be, for example single row read can take about 5ms.
So far i didn't care to much about my website speeds, but as the site grew bigger some pages started to require quite a few queries, for example one page requires to read 5 different tables and around 50 different rows, and so I have noticed that it takes from 0.7 sec to 2.0 secs which is really slow, so i took a closer look and found out that single query takes about 150ms.
The table that I'm testing is almost empty so size can't be an issue. I have installed APC and it did not help.
I am using PHPCassa and thrift comes along with this library.
Are these speeds normal, maybe php is just not fast enough? What could i do to improve this situation?
Note, I understand that running so many queries is to much and cassandra is optimized for writes not reads, but in some situations I can't find a way to put data in a single table/row.
EDIT I have just found out about optional C extension which should improve performance, and indeed it does, now single row read takes from 50ms to 100ms so that's a major improvement, thou still far away from those 5ms
EDIT2 Sorry for not updating my question with more information, but i have been very busy, and I have actually solved this problem, now 10 row reads from 4 different tables takes just 0.073158 s
and average read time is just 0.005575 s
so it's way more then I have expected to achieve. For those who are facing the same problem these are the things i would suggest to do:
- Install optional C extension, steps to do that can be found here
- Install APC
- Make sure that right java version is installed, this could be causing slowdown
- After installing all these things don't just restart apache, restart the whole server, I didn't do that at first and I only noticed this major speed improvement only after server restart