Redis implementation with its PHP extension
At the moment PHP extension for interfacing with Redis is shipped for all PHP versions from Plesk as plesk-phpXX-redis package. Redis server can be installed as Docker container managed by Plesk Docker feature.
—
IG
-
Anonymous commented
best idea
-
trialotto commented
Plesk Staff states:
"Redis server can be installed as Docker container managed by Plesk Docker feature."
and, in my humble opinion, it should be:
Redis can be installed as
a) a Docker container (not recommended, for many reasons),
b) a local Redis server instance on the server hosting Plesk (recommended for security reasons and also very easy to install and setup, also recommended in the light of performance)
c) a remote Redis server instance on a server (VPS or dedicated) in a local network (this can be a bit difficult to setup, so recommended for advanced Redis users only)
d) a Redis server from a SAAS provider or a Redis server in any cloud (highly recommended, it is making optimal use of Redis in a network environment that is maintained and that has been optimized for that specific purpose)
and the above is not even exhaustive, but an indication of some options available.
In short, using Docker would be doing the wrong thing for the right reasons: using Redis (right reason) via Docker (wrong thing, there are better alternatives).
In general, I would not like to see that Plesk customers are buying the Docker extension (a paid-for Plesk extension), when there are good alternatives that often better suit the objectives.
Regards........
-
Daniel Hendricks commented
FWIW, I have used the 'frodenas/redis' Docker image to allow private Redis instances. Within Plesk's Docker manager, you can easily add the REDIS_PASSWORD environmental variable. It is memory hungry, though, but I charge for it based on memory allocation.
-
trialotto commented
Question: are you suggesting that Onyx will allow to install Redis automatically in a Docker container? That is a bad idea, certainly under high workloads and/or from the perspective of security (the Redis container has be secured rather properly).
Can you elaborate or respond to the above?
-
Anonymous commented
That'd be great!
-
dreamer22 commented
Need integrated into Plesk caching service!
-
trialotto commented
In order to augment the power of nginx and add to the php redis support (as of version 5.6.1x), Odin should consider to add redis module(s) (note: four of them should be compiled in nginx).
-
H.K commented
A user should be able to run his own redis instance under pane hosting settings.
A version of redis should be supported under plesk updates and upgrades
A user should be able to run more than 1 redis instance or the host should be able to limit this, as per hosting package.
A user would click the redis section under hosting settings.
On a new page, the top menu would read.
New Redis instance, Delete Redis instance,
The redis instances would be shown in a list on this page.
Click the New Redis instance. Create a box asking for Port, Instance name and other relevant settings.
If possible hits percentage, memory usage, peak memory usage, and key in store could be displayed per Redis instance.
A similar thing for Memcached maybe also a good idea, But tested Memcached vs Redis recently and Redis is far superior.
Code for redis stats below
<?php
$fp = fsockopen('127.0.0.1', 6379, $errno, $errstr, 30);
$data = array();
if (!$fp) {
die($errstr);
} else {
fwrite($fp, "INFO\r\nQUIT\r\n");
while (!feof($fp)) {
$info = split(':', trim(fgets($fp)));
if (isset($info[1])) $data[$info[0]] = $info[1];
}
fclose($fp);
}
?>
<html>
<head>
<title>Redis statistics</title>
<style type="text/css">
body {
font-family: arial,sans-serif;
color: #111;
}
div.box {
background-color: #DFA462;
width: 200px;
height: 200px;
text-align: center;
margin: 6px;
float: left;
}
div.key {
font-weight: bold;
font-size: 42px;
}
div.detail {
text-align: left;
}
div.detail span {
width: 90px;
padding: 2px;
display: inline-block;
}
div.detail span.title {
text-align: right;
}
</style>
</head>
<body>
<div class='box'>
<div>Percentage hits</div>
<div class='key'><?php echo round($data['keyspace_hits'] / ($data['keyspace_hits'] + $data['keyspace_misses']) * 100)."%";?></div>
<div class='detail'>
<span class='title'>Hits</span>
<span><?php echo $data['keyspace_hits']; ?></span>
</div>
<div class='detail'>
<span class='title'>Misses</span>
<span><?php echo $data['keyspace_misses']; ?></span>
</div>
</div>
<div class='box'>
<div>Memory usage</div>
<div class='key'><?php echo $data['used_memory_human'];?></div>
</div>
<div class='box'>
<div>Peak memory usage</div>
<div class='key'><?php echo $data['used_memory_peak_human'];?></div>
</div>
<div class='box'>
<div>Keys in store</div>
<div class='key'>
<?php
$values = split(',', $data['db0']);
foreach($values as $value) {
$kv = split('=', $value);
$keyData[$kv[0]] = $kv[1];
}
echo $keyData['keys'];
?>
</div>
</div>
</body>
</html>