shawn246 / redis_client Goto Github PK
View Code? Open in Web Editor NEWa redis client supports cluster
a redis client supports cluster
Looks like the performance is not quite good while synchronized API can improve it l lot.
1480525631---1.48053e+09
std::string ConvertToString(double t)
{
std::stringstream sstream;
sstream << t;
return sstream.str();
}
int main(int argc, char *argv[])
{
time_t t = time(NULL);
double dt = (long) t;
std::cout<<std::to_string((int)t)<<"---"<<dt<<std::endl;
std::cout<<ConvertToString(dt)<<"---"<<std::endl;
return 0;
}
/opt/work/debug $ ./hh
1480525631---1.48053e+09
1.48053e+09---
/opt/work/debug $
It seems that the CRedisConnection::ConnRequest() method considers the server timeout value
in the configuration is always greater than zero.
But actually the default TIMEOUT value is zero in recent redis versions,
and TIMEOUT 0 means "the server never disconnects the clients".
Isn't it necessary to avoid reconnecting in the above situation?
I think the desirable code is like below.
if (!m_pContext || m_pRedisServ->m_nSerTimeout > 0 && tmNow - m_nUseTime >= m_pRedisServ->m_nSerTimeout)
As I open more than 10 connections (CRedisClients), it starts giving error loading shared libraries libc.so.6 and pipe: too many open files.
If I run it with ulimit -u unlimited -n 65536, still it gives error, but now at around 100 threads.
Each thread is continuously reading or writing in a tight loop.
Compiling the module for ARM-linux, I get the following.
ERROR = internal compiler error : in tsubst_copy, at cp/pt.c:1135
Confirmed this is not with hiredis, as I've run and compiled the tests as well as used the shared object in another project. This is using gcc/g++ 4.6.3. Your test makefile also uses the flag '-m64'. Is this module only designed to work with 64-bit operating systems? If so please add to the README, happy to run more tests if you need.
Best,
G
Sorry for opening an issue for this, I did not find any better means of contacting you.
I would like to invite your community to write a review for an alternative Redis client library that is being proposed for inclusion in Boost. As the author of a Redis client yourself your opinion would be highly valuable. For more information see https://lists.boost.org/Archives/boost/2023/01/253871.php.
Thanks
I guess others have seen the issue, does this guy still maintain this repository? I have a fix I tried to push but wasn't allowed to.
Thanks
I simply fix it by:
563 int CRedisCommand::CmdRequest(redisContext pContext)
564 {
565 if (m_nArgs <= 0)
566 return RC_PARAM_ERR;
567
568 if (!pContext)
569 return RC_RQST_ERR;
570
571 if (m_pReply)
572 {
573 freeReplyObject(m_pReply);
574 m_pReply = nullptr;
575 }
576
577 m_pReply = static_cast<redisReply *>(redisCommandArgv(pContext, m_nArgs, (const char *)m_pszArgs, (const size_t *)m_pnArgsLen));
+578 return m_pReply ? (m_pReply->type != REDIS_REPLY_ERROR ? RC_SUCCESS : RC_RQST_ERR) : RC_RQST_ERR;
579 }
Please tell me if any errors
Hi Shawn,
The interface seems very simple and effective.
However, I don't see anything related to publish/subscribe.
Can it be added easily?
Thanks
Patrick
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.