Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/io/http/options.cfa

    r8c58e73 r86c12d65  
    3838                10,    // backlog
    3939                1024,  // buflen
    40                 false  // reuseport
     40                false, // onereuse
     41                false  // manyreuse
    4142        },
    4243
    4344        { // cluster
     45                1,     // nclusters;
    4446                1,     // nprocs;
    4547                1,     // nworkers;
     
    5254
    5355void parse_options( int argc, char * argv[] ) {
     56        // bool fixedfd = false;
     57        // bool sqkpoll = false;
     58        // bool iokpoll = false;
    5459        unsigned nentries = 0;
     60        bool isolate = false;
     61
     62
    5563        static cfa_option opt[] = {
    5664                { 'p', "port",           "Port the server will listen on", options.socket.port},
    5765                { 'c', "cpus",           "Number of processors to use", options.clopts.nprocs},
    5866                { 't', "threads",        "Number of worker threads to use", options.clopts.nworkers},
     67                {'\0', "isolate",        "Create one cluster per processor", isolate, parse_settrue},
    5968                {'\0', "log",            "Enable logs", options.log, parse_settrue},
    6069                {'\0', "sout",           "Redirect standard out to file", options.reopen_stdout},
     
    6372                {'\0', "shell",          "Disable interactive mode", options.interactive, parse_setfalse},
    6473                {'\0', "accept-backlog", "Maximum number of pending accepts", options.socket.backlog},
    65                 {'\0', "reuseport",      "Use acceptor threads with reuse port SO_REUSEPORT", options.socket.reuseport, parse_settrue},
     74                {'\0', "reuseport-one",  "Create a single listen socket with SO_REUSEPORT", options.socket.onereuse, parse_settrue},
     75                {'\0', "reuseport",      "Use many listen sockets with SO_REUSEPORT", options.socket.manyreuse, parse_settrue},
    6676                {'\0', "request_len",    "Maximum number of bytes in the http request, requests with more data will be answered with Http Code 414", options.socket.buflen},
    6777                {'\0', "seed",           "seed to use for hashing", options.file_cache.hash_seed },
     
    91101                nentries = v;
    92102        }
     103        if(isolate) {
     104                options.clopts.nclusters = options.clopts.nprocs;
     105                options.clopts.nprocs = 1;
     106        }
    93107        options.clopts.params.num_entries = nentries;
    94         options.clopts.instance = 0p;
    95         options.clopts.thrd_cnt = 0;
     108        options.clopts.instance = alloc(options.clopts.nclusters);
     109        options.clopts.thrd_cnt = alloc(options.clopts.nclusters);
     110        options.clopts.cltr_cnt = 0;
     111        for(i; options.clopts.nclusters) {
     112                options.clopts.thrd_cnt[i] = 0;
     113        }
    96114
    97115
Note: See TracChangeset for help on using the changeset viewer.