���� JFIF �� � ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /proc/self/root/home/real/node-v13.0.1/benchmark/tls/ |
'use strict'; const fixtures = require('../../test/common/fixtures'); const tls = require('tls'); const common = require('../common.js'); const bench = common.createBenchmark(main, { concurrency: [1, 10], dur: [5] }); var clientConn = 0; var serverConn = 0; var dur; var concurrency; var running = true; function main(conf) { dur = conf.dur; concurrency = conf.concurrency; const options = { key: fixtures.readKey('rsa_private.pem'), cert: fixtures.readKey('rsa_cert.crt'), ca: fixtures.readKey('rsa_ca.crt'), ciphers: 'AES256-GCM-SHA384' }; const server = tls.createServer(options, onConnection); server.listen(common.PORT, onListening); } function onListening() { setTimeout(done, dur * 1000); bench.start(); for (var i = 0; i < concurrency; i++) makeConnection(); } function onConnection(conn) { serverConn++; } function makeConnection() { const options = { port: common.PORT, rejectUnauthorized: false }; const conn = tls.connect(options, () => { clientConn++; conn.on('error', (er) => { console.error('client error', er); throw er; }); conn.end(); if (running) makeConnection(); }); } function done() { running = false; // It's only an established connection if they both saw it. // because we destroy the server somewhat abruptly, these // don't always match. Generally, serverConn will be // the smaller number, but take the min just to be sure. bench.end(Math.min(serverConn, clientConn)); process.exit(0); }