Execute Redis command with server timeout - redis

Is there a way to execute a command in Redis, where you supply a server-side timeout?
For example, I want to execute a command that can take more than 3 sec.
In that case, I would want that the Redis server will stop the execution of the command after 3 sec (with no correlation to the client timeout).

NO.
You can do if and only if the command is made that way, e.g. BLPOP command.

Related

Wait for ssh connection to be available and run task with same ssh connection afterwards

The case:
Multiple servers try to connect a server with delegate_to and execute task simultaneously where ssh connection is limited with /etc/security/limits.conf and /etc/ssh/sshd_config and some of the servers fail due to limitation.
e.g: Server X has limits of 3 ssh connection at the same time. Servers 1,2,3,4,5 try to execute a task on Server X at the same time. They get error: too many logins for <remote_user>.
What I have tried:
Adding ssh retries to both ansible.cfg and delegate_to vars but it does not work because ssh retries for only return code of 255 where too many logins give 254
and doesn't try retry.
Adding wait_for_connection as a pre-task. This waits for possible connections but since this task and next task are independent, the ssh connection is independent too so it fails if another connection comes in at the same time after wait_for_connection.
Looking for any possible solution for this.
Notes: Every server runs its own ansible task. Ansible version is 2.9.9 on servers.

Application stops receiving data from remote machine

I am developing an app in VB.NET that connects to a remote Linux server to execute a task; my application sends input data for the server program, starts the execution in the server and retrieves output information from the server when the command execution is done. I use Renci SSH.NET to exchange files (SFTP) and monitor the remote server (SSH). One of the critical tasks is to detect when the remote machine finishes command execution, and depending on the input this can take between 5 minutes and many hours.
Here is my problem: for short runs (5 minutes or less), the application runs smoothly, no problems whatsoever. But, when the execution of the remote command takes more than 10 minutes, my application does not detect any response from the server and just hangs, since it never receives the indication from the server that the remote task is finished. I use the Renci.SshNet.Common.Stream.DataAvailable property to detect when the command is done by testing if the shell prompt string is present when I invoke Stream.Read().
Now, I know that the problem is the app, since when I execute the remote code "manually" (logging into the server with a terminal app and executing the command) it finishes without problems. I suspect it has something to do with the way Renci ShellStream object polls the remote machine for data. Any ideas as to what might be happening? Thank you in advance for your answers.

how to run redis monitor command in redis lua script instead of redis-cli monitor

I want to use redis lua to implement monitor command instead of redis-cli monitor. But I don't know how.
redis.call('monitor') doesn't work.
You can not call MONITOR from a Redis Lua script - MONITOR is a blocking command so it would block your script forever if allowed to be invoked.

Is it safe to run SCRIPT FLUSH on Redis cluster?

Recently, I started to have some trouble with one of me Redis cluster. used_memroy and used_memory_rss increasing constantly.
According to some Googling, I found following discussion:
https://github.com/antirez/redis/issues/4570
Now I am wandering if it is safe to run SCRIPT FLUSH command on my production Redis cluster?
Yes - you can run the SCRIPT FLUSH command safely in a production cluster. The only potential side effect is blocking the server while it executes. Note, however, that you'll want to call it in each of your nodes.

Execute command on remote server and execute next command without waiting for 1st to finish

I am not from a Unix background.
I have a query to perform on Unix to execute on remote server.
Requirements -
We have 11 Unix servers and I want to stop running the application on those servers without waiting for the query to finish on the 1st server, and the next query should run or start the same command at the same time on all servers at once.
Example:
//test.sh
ssh host1 'command'
ssh host2 'command'
Can anyone tell me how can I execute respective commands in script?
Use the parallel command.
parallel --onall -S ${host1},{host2} test.sh ::: command