I read all these articles about how fast cassandra could be, for example, reading a single line can take about 5 ms.
Until now, I didnโt really like the speed of my website, but as the site grew, some pages began to require quite a lot of queries, for example, one page needed to read 5 different tables and about 50 different lines and so I noticed that it takes from 0 , 7 seconds to 2.0 seconds, which is very slow, so I carefully examined and found out that one request takes about 150 ms.
The table I'm testing is almost empty, so size may not be a problem. I installed APC and it did not help.
I use PHPCassa , and thrift takes along with this library.
Are these speeds normal, maybe php is just not fast enough? What can I do to improve this situation?
Notice, I understand that launching a large number of queries is a lot, and cassandra is optimized for reading rather than reading, but in some situations I cannot find a way to put the data in one table / row.
EDIT I just found out about the optional C extension, which should improve performance, and indeed it does, now reading one line takes from 50 ms to 100 ms, so a significant improvement, you are still far from those 5 ms
EDIT2 Sorry, I am not updating my question with additional information, but I was very busy and I really solved this problem, now 10 rows are read from 4 different tables, it takes only 0.073158 s and the average reading time is only 0.005575 s , therefore he is much bigger than i expected. For those facing the same problem, this is what I suggest doing:
- Install the optional C extension, the steps for this can be found here.
- Install APC
- Make sure that the correct version of java is installed, this can cause a slowdown.
- After installing all these things, do not just restart apache, restart the entire server, I did not do this first, and I noticed only this significant speed improvement only after restarting the server.