scala - Forcing Redis to Timeout -
I am trying to force my radis client to timeout for the testing purpose and I fail to do so I am I specify the time limit of up to 2ms in my config and I set it to> 2ms, so why not do it timeout? Are these settings as soft settings and are not strict enforcement? I am doing zadis 2.6 and using Scala 2.10 with 2.2.3
@Singleton class extends the RedisClient cache {// set timeout value timeout = 2 private val Pool = new Jedispool (new zdispole config) GetStringFromConfig ("redis.url"), getIntFromConfig ("redis.port"), TIMEOUT); Def isOpen = pool.getNumActive () def set (key: string, value: string) = {isOpen match {case -1 = & gt; New exception throw ("Radis server is not running") Case _ = & gt; {Val jedis = pool.getResource () before the wall = current.timeTime jedis.set (key, value) println ("time taken" + (Platform.currentTime-before)) pool.returnResource (jedis)}}}} < Actually you do not need to check it but you can get the answer. Timeout value used: - As a Java Socket Connection Timeout
- More information about this as a value.
To achieve your test goal:
- Redis server should be heavily loaded during your testing to not accept connection. If you need connection timeout
- Try to use some proxy to leave connection perfomance (timeout by SO_TIMEOUT value).
Comments
Post a Comment