Answer the question
In order to leave comments, you need to log in
Why is Redis slow to get the value of a scalar key?
Good afternoon.
I am new to Redis.
Installed the server on Centos OS, no additional. did not make settings.
I use Radish as a client ( rediska.geometria-lab.net/).
Previously saved a scalar key to the database:
$options = array(
'servers' => array(
'server1' => array('host' => '127.0.0.1', 'port' => 6379)
)
);
$rediska = new Rediska($options);
$key = new Rediska_Key('keyName');
$key->setValue('value');
$options = array(
'servers' => array(
'server1' => array('host' => '127.0.0.1', 'port' => 6379)
)
);
$rediska = new Rediska($options);
$key = new Rediska_Key('keyName');
$key->getValue();
Answer the question
In order to leave comments, you need to log in
The time of the script to receive is from 8 to 15 ms.
$start_time = microtime(true);
$key->getValue();
$end_time = microtime(true);
echo $end_time-$start_time;
You ask about the time of receipt of the script, but it is not clear what you measure (by the way, how do you measure?)
You have already been told about the correct measurement.
Is it possible to install php extensions ? If there is, then the choice is obvious - https://github.com/nicolasff/phpredis and fuck the radish.
About persistent connection has already been answered.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question