all! I have a question about couchbase expire time. I update the TTL of the item using the function touch(). But the touch() can not make CAS value changes, should the concurrent be solved? Thanks
Related
I'm using Userparameter type with a curl shell command to check if a website live,if the site domain number is more than 1000 then, I set the check time as 5 minutes (in zabbix-agent active mode), but I found that many check items are in the queue waiting for a long time more than 10 minutes. So how can I improve the check speed
Indeed, Zabbix agent processes active items in a serial fashion [per server].
Possible solution - have an item that schedules an atd job, then sends data to trapper item[s].
In the future, the agent rewrite in Go will have parallel active check processing.
Does it make sense to use redis instead of mysql for many chats? Will there be an increase in speed? I think because of one thread redis speed Vice versa will fall.a
Yes , there are following advantages
Every time the user send data(message) I do not need to open mysql
connection and store on it. We can save it on redis and use pub/sub
to broadcast it on real time.
I can publish all those data and other clients(javascript/android)
can subscribe in a real time using message queue based on redis.
I can trigger real time alerts(like user gone offline etc)
Since Redis runs in memory, it is very fast but is disk persistent. So in case a crash happens, data is not lost. Redis can perform about 110,000 SETs and about 81,000 GETs per second
When a new consumer/brorker is added or goes down, Kafka triggers a rebalance operation. Is Kafka Rebalancing a blocking operation. Are Kafka consumers blocked while a rebalancing operation is in progress?
Depends on what you mean by "blocked". If you mean "are existing connections closed when rebalance is triggered" then the answer is yes. The current Kafka's rebalancing algorithm is unfortunately imperfect.
Here is what is happening during consumer rebalance.
Assume we have a topic with 10 partitions (0-9), and one consumer (lets name it consumer1) consuming it. When a second consumer appears (consumer2) the rebalance task triggers for both of them (consumer1 gets an event, consumer2 does the initial rebalance). Now consumer1 closes all the existing connections (even those that will be reopened soon) and releases the partition ownership in Zookeeper for all 10 partitions.
Then it runs the partition assignment algorithm and decides what partitions should be claimed and claims the partition ownership in Zookeeper again. If the claim was successful consumer1 starts fetching his new partitions.
Meanwhile consumer2 runs the partition assignment algorithm as well and tries to claim his partitions in Zookeeper as well. Claim will succeed only when consumer1 releases the ownership on these partitions. When the claim is successful consumer2 starts fetching, or if it fails to claim partitions within a given amount of retries you get a rebalance failed after n retries exception.
As you noticed instead of just closing connections and releasing ownership for partitions consumer1 does not own anymore, it unnecessarily closes ALL his connections and restarts with just a lower amount of partitions. The same story with adding partitions (when we consume by a wildcard filter and new topic appears) - ALL connections are closed and then opened again instead of just opening new ones.
So I hope this answers your question - fetching stops when rebalance kicks in.
The accepted response above (from serejja) was correct in the past. Kafka has implemented "Incremental Cooperative Rebalancing" from version 2.3 (release date June 2019) and above. So now there is no need for all consumers to stop the processing ("stop the world event") to rebalance work in group fe. when new consumer appears in group or some consumer goes offline.
For more info see: From Eager to Smarter in Apache Kafka Consumer Rebalances
I am using WinInet in C / C++ application to connect to a ASP.NET Web Service.
I want to increase my SESSION TIMEOUT time.
Currently somehow SESSION Time out is 20 minutes and I want to increase it to 50 minutes.
Which option do it use for the option INTERNET_OPTION_XXXXX in
InternetSetOption(hInstance, INTERNET_OPTION_XXXXX,(LPVOID) &timeout, sizeof(timeout));
Unlike WinHTTP that has WinHttpSetTimeouts there is no equivalent function available at WinINet.
I realise this is an old question however it seems there is no info on how to do this on SO. So I am posting this in case someone wants to know how to set timeouts with WinINet.
Normally you would use INTERNET_OPTION_CONNECT_TIMEOUT,INTERNET_OPTION_RECEIVE_TIMEOUT, or INTERNET_OPTION_SEND_TIMEOUT with InternetSetOption. See here for details on the option flags: https://learn.microsoft.com/en-us/windows/win32/wininet/option-flags
However, there is a bug which it seems MS has not fixed in about 20 years. The above timeout flags simply don't work.
So the way to work around this is to create second worker thread to watch for the connection request. The second request will kill the main connection request if it doesn't receive response from server in the timeout set. See this MS KB article for details and example:
https://mskb.pkisolutions.com/kb/224318
In IIS7, the processModel.idleTimeout property can be set in an application pool. A worker process will shut down after this specified period of inactivity.
However, I use Application_Start to run a number of jobs. If there is no visitor to the website the jobs would be disposed and will not run on time.
In IIS 7, the Regular Time Interval (periodicRestart), that specifies when process recycling happens, must be bigger than the idleTimeout.
Is it safe enough if I set larger values for the idleTimeout and periodicRestart?
In order to avoid my application exiting and to be on the safe side, I have configured the idleTimeout to 0 (infinity) and periodicRestart to the default value (1740 minutes).
After a few days working with this configuration, I haven't found problems so far. The application doesn't quit and it is quite safe that after 1740 minutes it will restart.