1

I have a service which binds many NBD servers to a network interface at startup, each with their own IPv6 address. In order to do this, the addresses first need to be added to the correct interface. At the moment, this is done serially, with one execution of:

ip addr add <foo> dev <bar>

per NBD device. There's a matching sequence of ip addr del at shutdown.

I'd like to speed this up by forking these invocations so they run in parallel. Is this known to be safe, known to be unsafe, or neither? The man page doesn't help, and I confess that the source would go over my head. I'm not really satisfied by just running it and seeing it work, because I can't know if I just got lucky.

If it matters, I'm running this on Debian Squeeze, which has kernel version 2.6.32.

regularfry
  • 215
  • 2
  • 11

2 Answers2

2

yes, IP addresses can be done in parallel. Clustering software like pacemaker or heartbeat does this all the time.

phemmer
  • 5,909
  • 2
  • 27
  • 36
1

I doubt the time needed to actually set the IP address is significant here, rather, it's the overhead of forking the various commands. You may fare better with a dedicated program that directly talks to the kernel.

Simon Richter
  • 3,317
  • 19
  • 19