Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
1
answers
1203
views
SSH Configuration for multiple IP addresses (round-robin or randomized)
I have a machine that I am using as an SSH jumphost which has multiple ethernet ports each of which has its own IP address (192.168.1.22 and 192.168.1.178 in case it matters). I use SSH for a lot of stuff, in particular large file transfer. I would like to evenly distribute SSH traffic amongst these...
I have a machine that I am using as an SSH jumphost which has multiple ethernet ports each of which has its own IP address (192.168.1.22 and 192.168.1.178 in case it matters). I use SSH for a lot of stuff, in particular large file transfer. I would like to evenly distribute SSH traffic amongst these two ethernet ports. I don't really care if its a round-robin configuration or if every time I connect it picks one of the two IP addresses at random so long as the traffic is more-or-less evenly distributed.
On top of this, the jumphost is accessible via SSH from the outside world with two port-forward configurations, one port (let's say 22) points to the first IP address and another (let's say 2222) points to the other IP address. Its arguably more important that I figure out how to "round-robin" between the two ports rather than the two IP addresses since the jumphost matters most when I am outside my network.
Is there an SSH config example I could use for something like this? I've been unable to find one. Potentially using the Match keyword? I've tried adding multiple IP addresses to the Host field, but it just uses the first one and ignores the rest.
RedHack
(141 rep)
Nov 24, 2022, 02:00 AM
• Last activity: Dec 10, 2022, 04:25 AM
-2
votes
1
answers
875
views
round-robin in bash script
i have this task to do, but im actually stuck with this round-robin algorithm, here's the details input file there are 3 process A, B and C second column is the arrival time third column is nut value ``` A 1 2 B 2 3 C 0 4 ``` i understand the idea that process with AT=0 status should be R=running th...
i have this task to do, but im actually stuck with this round-robin algorithm, here's the details input file there are 3 process A, B and C second column is the arrival time third column is nut value
A 1 2
B 2 3
C 0 4
i understand the idea that process with AT=0 status should be R=running then the next process with AT status should present as W=waiting after the process has reached the nut value, for ex 4 R status next seq should be F=finished output like
A B C
0 - - R
1 W - R
2 R W W
3 W W R
4 W R W
5 R W W
6 F W R
7 F R F
8 F R F
9 F F F
i tired to use the same idea of first come first serve but it's different as here we have to use the round robin algorithm and i didn't saw it before in bash if just someone give me the idea and i will try to continue till the end
nut value in the third column mean for ex first process A =2
so it must have two running status then it be finished
process C=4, must have 4 running status then finished and so on
the algorithm is round-robin i found this is the suitable one as the running status changes each line between the processes
yes each time only one running status and the other either not arrived yet or in waiting status
peter louis
(29 rep)
Nov 21, 2022, 10:33 AM
• Last activity: Nov 22, 2022, 02:54 PM
5
votes
1
answers
1484
views
round robin for curl and dnsmasq
I have setup dnsmasq to the basic configuration, pointing a file with two IP addresses. 10.0.0.1 a.b.c 10.0.0.2 a.b.c When I do nslookup or dig on a.b.c, I see round robin seems to be in effect (as I would expect since as far as I know round robin is the default in dnsmasq). But when I curl or ping...
I have setup dnsmasq to the basic configuration, pointing a file with two IP addresses.
10.0.0.1 a.b.c
10.0.0.2 a.b.c
When I do nslookup or dig on a.b.c, I see round robin seems to be in effect (as I would expect since as far as I know round robin is the default in dnsmasq). But when I curl or ping a.b.c, I always get the same response. The obvious first response is that the response is being cached, but from what I can tell, curl does not cache the response and when you use the -v flag for curl the first line printed is something like "cache missed".
So what I am wondering is: am I doing something wrong in my setup? Is there somewhere else that the caching could possibly be happening? I can provide exact files or more info, but I'm currently a bit lost as to why I don't see the rotating happening.
mccormickt12
(151 rep)
Jun 17, 2016, 11:55 PM
• Last activity: Aug 17, 2021, 09:12 PM
1
votes
1
answers
3809
views
How to set the SCHED_RR time slice or time quantum per process / thread?
The time slice (also called time quantum) for threads with `SCHED_RR` policy can, according to the [sched_rr_get_interval man page][1] be obtained using int sched_rr_get_interval(pid_t pid, struct timespec *tp); This indicates that there could be different values set for different processes / thread...
The time slice (also called time quantum) for threads with
SCHED_RR
policy can, according to the sched_rr_get_interval man page be obtained using
int sched_rr_get_interval(pid_t pid, struct timespec *tp);
This indicates that there could be different values set for different processes / threads. According to the same man page , however, the value can (since kernel 3.9) be adjusted using /proc/sys/kernel/sched_rr_timeslice_ms
, which, however, does not seem to allow to change the configuration per thread in a sensible way.
Other places dealing with real-time scheduling also do not provide information how the time slice for SCHED_RR
threads can be set per thread (man chrt , man sched_setattr , SO: How to know linux scheduler time slice? ).
It it possible to set the time slice individually per SCHED_RR
thread? If so, what is the preferred approach to do so?
Dirk Herrmann
(686 rep)
Feb 20, 2019, 05:16 PM
• Last activity: Apr 18, 2020, 04:19 PM
0
votes
1
answers
201
views
Thread safe next number (or round-robin) service in linux
I have an Ubuntu machine and a scenario in which I need to generate the next number (starting from X) between 0 and 20 in a round-robin way. I need a way to get the next number which will be thread safe, some sort of script (maybe?) which provide me the "next-number" in a round-robin way. It is very...
I have an Ubuntu machine and a scenario in which I need to generate the next number (starting from X) between 0 and 20 in a round-robin way.
I need a way to get the next number which will be thread safe, some sort of script (maybe?) which provide me the "next-number" in a round-robin way.
It is very easy to write a script which saves a value into the filesystem, and every time someone asks for the next number, it will increment and save it again.
The problem is, this is not thread safe, and will not provide a real round-robin scenario. I am assuming the script might be called in parallel which might destroy the file.
Also, writing to a file seems very slow scenario...(I can live with that, if this is the only way)
Does anyone know on some other way to do that?
winter
(101 rep)
Mar 8, 2020, 02:59 PM
• Last activity: Mar 27, 2020, 02:32 AM
1
votes
1
answers
1550
views
HTTP Session Management while using Nginx as in “Round Robin” mode Load-balancer?
I'm trying to load-balance "2 Web Servers (running Apache/PHP)" by putting nginx in front of them. But **I need to use Round Robin algorithm** but when I do this, **I can't manage to have the stable SESSIONS**. (I understand; if I use Round Robin, the session information will be lost once I hit to t...
I'm trying to load-balance "2 Web Servers (running Apache/PHP)" by putting nginx in front of them. But **I need to use Round Robin algorithm** but when I do this, **I can't manage to have the stable SESSIONS**.
(I understand; if I use Round Robin, the session information will be lost once I hit to the another server on next load)
Is there a proper way to achieve this? Any kind advice for the industrial standards on this please?
*FYI, I've already put these 2 Web Servers into
GlusterFS
as in Cluster. So I have a common storage (if you are going to suggest something based on this)*
夏期劇場
(1671 rep)
Feb 1, 2016, 08:19 AM
• Last activity: Jan 26, 2017, 11:19 AM
Showing page 1 of 6 total questions