Re: [libmicrohttpd] Why MHD latency is so high on Windows?

2015-11-16 Thread silvioprog
Oops, I forgot the log:

Status 200 OK
Loading time: 249ms
Connection: Keep-Alive
Content-Length: 37
Content-Type: text/html
Date: Sun, 15 Nov 2015 18:11:02 GMT

This log was done by Google Chrome Advanced REST Client:
https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo

On Sun, Nov 15, 2015 at 3:06 PM, silvioprog  wrote:

> Hello,
>
> I'm using MHD in production, so I noticed a small problem in a customer:
> the MHD latency is very high. It is about 250ms. (Apache24 - 15ms; Nginx -
> 2ms; NodeJS - 5ms; Jetty - 5ms; libevent - 3ms)
>
> You can't reproduce it testing in localhost, so you need two machines. If
> you want to test that, it is very easy:
>
> - run a Windows 7, 8 or 10 in a VM (like VirtualBox);
> - ping this virtual machine from your real machine and look if latency is
> OK (<1ms);
> - compile this basic example and run it on the virtual machine [1];
> - now, in your real machine, using something like a JMeter or just a HTTP
> client like this Chrome extension [2], access your HTTP server running in
> your virtual machine (usually http://192.168.56.102:8080).
>
> I tested it using other examples like the `demo.c` and the
> `fileserver_example_external_select.c`, and I saw the same problem. :-/
>
> I need to do some configuration to get a better latency? (at least 100ms,
> because 250/300ms is so slow)
>
> Thank you!
>
> [1] - http://pastebin.com/AmAVvxky
> [2] - Postman,
> https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop
>
> --
> Silvio Clécio
>



-- 
Silvio Clécio


[libmicrohttpd] Why MHD latency is so high on Windows?

2015-11-16 Thread silvioprog
Hello,

I'm using MHD in production, so I noticed a small problem in a customer:
the MHD latency is very high. It is about 250ms. (Apache24 - 15ms; Nginx -
2ms; NodeJS - 5ms; Jetty - 5ms; libevent - 3ms)

You can't reproduce it testing in localhost, so you need two machines. If
you want to test that, it is very easy:

- run a Windows 7, 8 or 10 in a VM (like VirtualBox);
- ping this virtual machine from your real machine and look if latency is
OK (<1ms);
- compile this basic example and run it on the virtual machine [1];
- now, in your real machine, using something like a JMeter or just a HTTP
client like this Chrome extension [2], access your HTTP server running in
your virtual machine (usually http://192.168.56.102:8080).

I tested it using other examples like the `demo.c` and the
`fileserver_example_external_select.c`, and I saw the same problem. :-/

I need to do some configuration to get a better latency? (at least 100ms,
because 250/300ms is so slow)

Thank you!

[1] - http://pastebin.com/AmAVvxky
[2] - Postman,
https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop

-- 
Silvio Clécio


Re: [libmicrohttpd] Small upgrade for MHD home page

2015-11-16 Thread silvioprog
Hm... about Windows package, the problem is just to keep an old version on
home page, because there is the first place that an user find the lib, and
this very old version miss a lot of important fixes. :-/

I have two sugestions to distribute the Windows package on home page:

1. keep only the latest compiled version (I can help you building the
binaries);
2. keep only the sources of the latest version (eg
libmicrohttpd-0.9.46.zip).

I'm expecting a better market to the lib. :-)

On Fri, Nov 13, 2015 at 4:31 AM, Christian Grothoff 
wrote:

> Hi!
>
> I've bumped the source link to actually match the last release.
> I don't build the W32 binary, so I cannot help it being outdated.
>
> Also, unlike NodeJS [1] our source build is not insane, and if you're
> using MHD and you cannot build from source, it won't be of much use to
> you. And for end-users, the respective operating system distribution
> package manager should provide binaries anyway. As most end-users
> wouldn't know how to check signatures on downloaded binaries, that's
> also the only way to get them (relatively, see [2]) secure binaries.
>
> (That doesn't matter for W32, that's a lost cause anyway.)
>
>
> Happy hacking!
>
> Christian
>
> [1]
>
> http://dthompson.us/reproducible-development-environments-with-gnu-guix.html
> [2] https://gnunet.org/guix2015video


-- 
Silvio Clécio


Re: [libmicrohttpd] Why MHD latency is so high on Windows?

2015-11-16 Thread Nils Durner
Hi Silvio,

it's been a while since I have looked at the code last, but we used to have
an event loop in the Windows implementation of select() (in PlibC) that
switches between waiting on sockets and waiting on other handles
(specifically, a shutdown signalling pipe handle) every 200ms.

Just to see if this the source of the 250ms delay, you could remove the
waiting-on-handles part from PlibC select.c.

Hope this helps,

Nils