mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-29 04:09:31 +03:00
use 127.0.0.1 instead of localhost for testcurl/*.c;
performs far better on OS X and Solaris-style kernels Will Bryant (<will.bryant@gmail.com>) writes: On 21/09/2011, at 20:14 , Christian Grothoff wrote: > > On the OpenIndiana performance, do you have something like 'strace' where you > > could monitor what's going on? Most likely the code hangs blocking in some > > syscall for longer than it should... It has truss, and for the record, it showed no slow calls. The problem turned out to be the tests using "localhost", which was picking the primary interface for the box, not the loopback interface. Changing perf_get_concurrent.c to use 127.0.0.1 makes it vastly faster - it went from ~35 requests/sec to 12,000-15,000 requests/sec. It makes a big difference on OS X too - from 115-140 requests/sec on my old macbook to 600-3600 requests/sec (variation here mainly due to the large amount of other stuff I have running). Patch attached.
This commit is contained in:
1 parent
b6f6b9a5cc
commit
fe7ed03a63
24 files changed
+69
-69
No files matched your search
@@ -108,7 +108,7 @@ testExternalGet ()
|
||||
}
|
||||
|
||||
c = curl_easy_init ();
|
||||
curl_easy_setopt (c, CURLOPT_URL, "https://localhost:1082/hello_world");
|
||||
curl_easy_setopt (c, CURLOPT_URL, "https://127.0.0.1:1082/hello_world");
|
||||
curl_easy_setopt (c, CURLOPT_WRITEFUNCTION, ©Buffer);
|
||||
curl_easy_setopt (c, CURLOPT_WRITEDATA, &cbc);
|
||||
/* TLS options */
|
||||
|
||||
@@ -277,7 +277,7 @@ gen_test_file_url (char *url, int port)
|
||||
ret = -1;
|
||||
}
|
||||
/* construct url - this might use doc_path */
|
||||
if (sprintf (url, "%s:%d%s/%s", "https://localhost", port,
|
||||
if (sprintf (url, "%s:%d%s/%s", "https://127.0.0.1", port,
|
||||
doc_path, "urlpath") < 0)
|
||||
ret = -1;
|
||||
|
||||
|
||||
Reference in new issue
Block a user