2 * Chained pipe test with 900,000 processes and 900,000 pipes
4 * Requires system w/ 128GB+ of ram, kern.maxproc=4000000 set in
5 * /boot/loader.conf. 80 second stabilization time after last
8 * Also test tear-down by ^C'ing the test.
10 #include <sys/types.h>
13 #include <sys/resource.h>
24 main(int ac, char **av)
38 for (i = 0; i < COUNT; i += 100) {
40 asprintf(&path, "cp %s /tmp/x%06d", av[0], i);
43 asprintf(&path, "/tmp/x%06d", i);
45 asprintf(&path, "%s", av[0]);
47 asprintf(&id, "%d", i);
55 execl(path, path, id, NULL);
60 fdsbeg[0] = fdsend[0];
62 printf("running %d\r", i);
69 idno = strtol(av[1], NULL, 0);
70 setpriority(PRIO_PROCESS, 0, 5);
71 for (j = 0; j < 100; ++j) {
76 if (j == 99 || fork() == 0) {
83 setpriority(PRIO_PROCESS, 0, 15);
86 if (read(0, &c, 1) < 0)
89 fprintf(stderr, "x%d\n", idno + j);
100 while (wait3(NULL, 0, NULL) >= 0 || errno == EINTR)
104 printf("running %d\n", i);
106 write(fdsbeg[1], &c, 1);
107 if (read(fdsend[0], &c, 1) < 0)