Xle perf improvement (#1)

* alpha version of proxy
* alpha version of proxy
* fix method bug
* fix post deode bug
* regen archive
* Reduce CPU usage on idle in proxy mode:
  - Scheduler timeout event now support millisecond granularity
  - Use only READABLE event on proxy socket which reduce tasks CPU time
* use both readable event and timeout event
* reduce scheduler poll time
* Fix segmentfault error
* Log worker task in statistic
* fix high cpu usage when handling bad POST request
* fix event-stream handling bug on proxy mode
* fix missing data events when uploading
* Race condition when get IP address from host in proxy mode
  - ip_from_hostname() is not thread safe
  - use global lock mechanism
This commit is contained in:
Xuan Sang LE
2021-02-24 18:12:36 +01:00
committed by GitHub
parent ce5549d394
commit dd7ff9b434
8 changed files with 400 additions and 88 deletions

10
httpd.c
View File

@ -297,6 +297,12 @@ void antd_scheduler_ext_statistic(int fd, void *user_data)
void antd_scheduler_destroy_data(void *data)
{
antd_request_t *rq = (antd_request_t *)data;
antd_client_t *proxy = (antd_client_t *)dvalue(rq->request, "PROXY_HANDLE");
if(proxy)
{
close(proxy->sock);
}
finish_request(data);
}
@ -306,8 +312,8 @@ int antd_task_data_id(void *data)
if(!rq)
return 0;
return antd_scheduler_next_id(scheduler,rq->client->sock);
//UNUSED(data);
//return antd_scheduler_next_id(scheduler,0);
/*UNUSED(data);
return antd_scheduler_next_id(scheduler,0);*/
}
int main(int argc, char *argv[])