生成http响应头(http只是一种格式)-测试优化

  http 只是一种格式。
  还缺少date ,但是已经可以用了 curl 测试

 
  evutil_socket_t fd = bufferevent_getfd(bev);
  bufferevent_write(bev, "HTTP/1.1 200 OK\r\n", 17);
  bufferevent_write(bev,"Content-Type: text/html;charset=utf-8\r\n",39);
  bufferevent_write(bev, "Content-Length: 6\r\n",19);
  bufferevent_write(bev, "Connection: keep-alive\r\n",24);
  //bufferevent_write(bev, "Connection: close\r\n",19);
  bufferevent_write(bev, "\r\n\r\n", 4);
  bufferevent_write(bev, "test", 4);


vi /etc/sysctl.conf
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 1024    65000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 5000
/sbin/sysctl -p

vi  /etc/profile
ulimit -HSn 65536
source  /etc/profile

./http_load -p 80 -s 60 libeventTest.txt


你可能感兴趣的:(http)