Async-Microservice

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


  GET_sleep

    https://time.meon.eu/v1/sleep?duration=2.5

    This is the only parallel processed reponse method (the other ones are
    pure CPU-only bound) that sleep given (or random) number of seconds and
    only then returns the request response with when it started and how
    long it took. Normally this the same as what is in duration parameter,
    but in case the server is overloaded with requests, the event loop may
    call the timer handler much later than the duration. Try:

        ab -n 1000 -c 500 http://localhost:8085/v1/sleep?duration=3
        Connection Times (ms)
                      min  mean[+/-sd] median   max
        Connect:        0  259 432.8     21    1033
        Processing:  3001 3090  72.5   3061    3253
        Waiting:     3001 3090  72.5   3061    3253
        Total:       3022 3349 394.1   3155    4065

    Then try to run together with 100% CPU load:

lib/Async/Microservice/Time.pm  view on Meta::CPAN


=head3 GET_sleep

L<https://time.meon.eu/v1/sleep?duration=2.5>

This is the only parallel processed reponse method (the other ones are
pure CPU-only bound) that sleep given (or random) number of seconds and
only then returns the request response with when it started and how long
it took. Normally this the same as what is in duration parameter, but in
case the server is overloaded with requests, the event loop may call the
timer handler much later than the duration. Try:

    ab -n 1000 -c 500 http://localhost:8085/v1/sleep?duration=3
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        0  259 432.8     21    1033
    Processing:  3001 3090  72.5   3061    3253
    Waiting:     3001 3090  72.5   3061    3253
    Total:       3022 3349 394.1   3155    4065

Then try to run together with 100% CPU load:



( run in 0.926 second using v1.01-cache-2.11-cpan-49f99fa48dc )