Manlio Perillo Wrote: ------------------------------------------------------- > Tronman ha scritto: > > Hi there, > > > > I'm looking for a way to find the fully > qualified path of the "PID" file at run time. > > What do you mean by "run time"? > > The path to the PID file is well know. > > You just need to check whenby Tronman - Nginx Mailing List - English
Or.... If there is a better way to tell if the server (or a module) is starting or stopping, I'd be interested in knowing that too! Thanks.by Tronman - Nginx Mailing List - English
Hi there, I'm looking for a way to find the fully qualified path of the "PID" file at run time. Basically, I've got some code that I need to run when the server is starting, and some different code I need to run when the server is shutting down (daemon mode). I use fopen("logs/nginx.pid", "r") == NULL to decide if the file exists of not. If it doesn't, I assby Tronman - Nginx Mailing List - English
Hey folks, Is there something which might cause Nginx to call the post body handler (set with ngx_http_read_client_request_body) before it actually reads the body? Maybe like a timeout or something? I've been analyzing traffic with tcpdump, and most of the time, I see: 1. Headers (with content length) 2. Body (of content length size) 3. Response but sometimes my handler gets a garblby Tronman - Nginx Mailing List - English
Almost there! I found a ngx_http_finalize_request I was forgetting about. That's gone and now: 1. I can connect with one client, have it wait a specified number of seconds, then send the headers and finalize the request. 2. I can connect with another client, while the first is waiting, and it doesn't get blocked. If it's a non-waiting connection it returns like it should. 3. But if I tby Tronman - Nginx Mailing List - English
Two problems solved, one more found: Solved: 1. I wasn't specifying a wakeupFromSleep->log, so I was seg faulting on the: ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0, "event timer add: %d: %M:%M", ngx_event_ident(ev->data), timer, ev->timer.key); line in ngx_event_add_timer from ngx_event_timer.h 2. I was specifyiby Tronman - Nginx Mailing List - English
Shoot, I just realized my ngx_add_timer(wakeupFromSleep, 30); call was never returning. Looking in the logs it looks like a segfault...but why? Hmm...by Tronman - Nginx Mailing List - English
agentzh wrote: >Heh, it reminds me of the echo_sleep and echo_blocking_sleep >directives in the ngx_echo module: Tronman wrote: >I took a look at that module, and it does seem somewhat similar, except I want the sleep to be specifiable >from the code, not the configuration file. I'm not sure what's being done differently to implement it that >I'm not doing. Ah, it appeaby Tronman - Nginx Mailing List - English
Hi folks, thanks for your responses! As a quick note, I've been using ngxin 0.7.64 Marcus Clyne wrote: >As a side-note here, this should have included returning a failure - you >would have got a segfault on failure otherwise For sure, I'm just experimenting for now, not too much error handling. >You should use ngx_add_event () here instead of allocating the space for >the eby Tronman - Nginx Mailing List - English
Hi there, I'm trying to figure out how to implement a non blocking delay between when a request comes into a module, and when it is responded too. For example, consider a blocking delay: static ngx_int_t ngx_http_my_module_handler(ngx_http_request_t *r) { r->headers_out.status = NGX_HTTP_OK r->header_only = 1; r->headers_out.content_length_n = 0; ngx_sleep(10);by Tronman - Nginx Mailing List - English
> 1. On FreeBSD you can try to increase kern.ipc.somaxconn. I bet 8192 > would be enough for your test. This is socket backbuffer which can cache > connections before server actually accepts them. Ahhhh...on Ubuntu it's net.core.somaxconn, for which mine was only set to 128. I didn't even have to go that high, just up to the number of simultaneous connections I was specifying in cby Tronman - Nginx Mailing List - English
> This all sounds like your module is taking focus and computes something > for a long time (more than 10 msec) without giving focus back. This way > when buffers are full there's no one to pick connections from them so > any connection will time out without response. It's just because your > module is written so. That makes sense. How do I make it give back focus while stillby Tronman - Nginx Mailing List - English
One more thing: > I can add usleeps to the static module and get time outs, but my module seems to get them even without it. They don't always occur in the static module, even with a usleep, and at a much slower rate even when they do. So it's still doing something I don't understand, even though I can copy and paste the above code into it and run it!by Tronman - Nginx Mailing List - English
Hi there, Thanks for your response, sorry it took me so long to reply. > 1. On FreeBSD you can try to increase kern.ipc.somaxconn. I bet 8192 > would be enough for your test. This is socket backbuffer which can cache > connections before server actually accepts them Currently, the OS I'm running on is Ubuntu 9.10, single core Intel with 1024 MB ram. But if I try a sysctl kern.iby Tronman - Nginx Mailing List - English
Piotr Sikora Wrote: ------------------------------------------------------- > > But I'm still not clear on why nginx is sending > time outs at all. That is, > > if it takes longer to generate the response, > shouldn't it just take longer > > to send to response? Is there a configurable > value somewhere that's > > causing nginx to send a time out? >by Tronman - Nginx Mailing List - English
Hello, I've been playing around with writing an nginx module and trying to configure it to run at high load (testing with the curl-loader tool). My bench mark is the http-static-module, that is, I want to run at least as much load on my module as the static module can without errors. I'm also (for now) keeping the default number of worker processes (1) and worker connections (1024), but more onby Tronman - Nginx Mailing List - English
Nick Pearson Wrote: ------------------------------------------------------- > curl is a good way to test URLs without having to > re-type everything > each time. You can POST by using the -d or -f > option. Much better > than telnet for this type of testing, in my > experience. Yes, I've heard of cURL but hadn't used it a whole lot. I've installed it and will give itby Tronman - Nginx Mailing List - English
> Most likely you did something wrong, either while > telneting or in you module. Precisely, it was a mistake I was making with my telnet session. I misinterpreted "sending" as really just inserting a couple of new lines. Also, it worked properly when I wrote a simple form to POST in Firefox. Great! Your response cleared up nearly everything for me, the only other thing I'mby Tronman - Nginx Mailing List - English
> This implies that the client program connecting to the server must use separate "send" calls to send the > header first, then the body, and cannot put both a header and a body into the same buffer and send > them at the same time. Is this the case? Ah, I'm wrong on this. It's just the screwy way Telnet was sending the data chunks.by Tronman - Nginx Mailing List - English
Hi there, Thanks for your response! I'm still trying to get the hang of the I/O model going on here. Bare with me to see if I understand: When a connection comes in, the "ngx_http_my_module_handler" is called. This function has the request headers, but not the request body. In "ngx_http_my_module_handler", we can use "ngx_http_read_client_request_body(r, ngx_http_my_by Tronman - Nginx Mailing List - English
Hi there, I recently created a custom Nginx module, and successfully compiled it into the Nginx source and used a location directive to direct traffic to my module (good job me). In my modules handler, I of course have access to the ngx_http_request_t *r object passed into the function. Using this object, I have no trouble: 1. Getting the request headers (r->headers_in) 2. Settingby Tronman - Nginx Mailing List - English
![]() |
![]() |
![]() |
![]() |
![]() |