dynamic linking files slow fork down significantly

From: David Lang
Date: Fri Mar 02 2007 - 20:18:54 EST


I have a fork-heavy workload (a proxy that forks per connection, I know it's not the most efficiant design) and I discovered a 2x performance difference between a static and dynamicly linked version of the same program (2200 connections/sec vs 4700 connections/sec)

I know that there is overhead on program startup, but didn't expect to find it on a fork with no exec. If I has been asked I would have guessed that the static version would have been slower due to the need to mark more memory as COW.

what is it that costs so much with dynamic libraries on a fork/clone?

according to strace, the clone call that's being made is
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7c92c08)

David Lang
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/