Ignore:
Timestamp:
Feb 1, 2021, 3:48:19 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
5e99a9a
Parents:
f99f5ba
Message:

Added the option to pre-accept in httpring, this seems to have a major impact.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/http_ring.cpp

    rf99f5ba rc235179  
    2020                socklen_t *addrlen;
    2121                int flags;
     22                unsigned cnt;
    2223        } acpt;
    2324
     
    433434        // Accept our first connection
    434435        // May not take effect until io_uring_submit_and_wait
    435         connection::accept(ring, opt);
     436        for(unsigned i = 0; i < opt.acpt.cnt; i++) {
     437                connection::accept(ring, opt);
     438        }
    436439
    437440        int reset = 1;       // Counter to print stats once in a while
     
    528531        unsigned entries = 256;     // number of entries per ring/kernel thread
    529532        unsigned backlog = 262144;  // backlog argument to listen
     533        unsigned preaccept = 1;     // start by accepting X per threads
    530534        bool attach = false;        // Whether or not to attach all the rings
    531535        bool sqpoll = false;        // Whether or not to use SQ Polling
     
    534538        // Arguments Parsing
    535539        int c;
    536         while ((c = getopt (argc, argv, "t:p:e:b:aS")) != -1) {
     540        while ((c = getopt (argc, argv, "t:p:e:b:c:aS")) != -1) {
    537541                switch (c)
    538542                {
     
    548552                case 'b':
    549553                        backlog = atoi(optarg);
     554                        break;
     555                case 'c':
     556                        preaccept = atoi(optarg);
    550557                        break;
    551558                case 'a':
     
    681688                thrd_opts[i].acpt.addrlen = (socklen_t*)&addrlen;
    682689                thrd_opts[i].acpt.flags   = 0;
     690                thrd_opts[i].acpt.cnt     = preaccept;
    683691                thrd_opts[i].endfd        = efd;
    684692                thrd_opts[i].ring         = &thrd_rings[i].storage;
Note: See TracChangeset for help on using the changeset viewer.