Hi guys, Some days ago, one of this module users complaint about the unfair speed for multi-connections. So I have some time to realize a new method to limit download rate. In the new code, if last second speed is lager than max rate, the timer is added in this module, and the body filter will return. So nothing will be sent to client, and do not use the r->limit_rate in write_filter toby bigplum - Nginx Mailing List - English
I found this problem before, but I'm not sure how to modify it. The reason is: Lua table index is begin from 1, but array in mongodb is 0. So there will be a undefined element in mongodb array whose index is 0. If we modify the driver to make index=index-1 when insert into mongodb and index=index+1 when read from mongodb, the "undefined" will be eliminated. We will found that thby bigplum - Nginx Mailing List - English
Hi, I install the newest nginx, and run 3 benchmark tools: ab/http_load/weighttp. I get three rps results 9129.48/2594.08 /1107. So which tool give the right result? # ab2 -n 10000 -c 1000 http://10.6.2.213/ This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, hby bigplum - Nginx Mailing List - English
The r->unparsed_uri has been used to cat.by bigplum - Nginx Mailing List - English
Thanks to Maxim Dounin. Finally I modify the module. Cat the URI string to $np_uri, make $np_uri like that http://backend/filename.ext.by bigplum - Nginx Mailing List - English
Hi, Previously, I wrote a module to make a subrequest to backend. nginx.conf like that: location /file { nphase_uri /dummy; nphase_set_uri_var $np_uri http://backend; } location /dummy { proxy_pass $np_uri; } The module could send original URI "http://localhost/file/abcd.txt" to backend to process. And the module could get response from backend and decide toby bigplum - Nginx Mailing List - English
It's OK now by refering to agentzh's steps. thanks all. Additionally, maybe it's useful to set ftp mode before running "make": export BM_UPLOAD_FTP_PASSIVE="true" otherwise this error would occur: *** Installing dependencies... Can't use an undefined value as a symbol reference at /usr/share/perl/5.10/Net/FTP/dataconn.pm line 54. Compilation failed in require at iby bigplum - Nginx Mailing List - English
Hi, This demo maybe helpful. https://github.com/bigplum/nginx-http-nphase-moduleby bigplum - Nginx Mailing List - English
I've put test-nginx into a test directory, but it shows can't locate socket.pm. Do I need to install TEST::NGINX into perl lib directory? # ll test 总用量 60 drwxr-xr-x 5 root root 4096 2012-01-01 08:00 ./ drwxr-xr-x 5 simon simon 4096 2012-01-13 17:31 ../ -rw-r--r-- 1 root root 8018 2012-01-01 08:00 Changes -rw-r--r-- 1 root root 298 2012-01-01 08:00 .gitignore drwxr-xr-x 4 roby bigplum - Nginx Mailing List - English
nginx.conf: location / { .... set $var "$uri=200k" .... and run "curl localhost/" The module use ngx_http_get_indexed_variable() for $var will get the string "/=200k", but I want the value is "$uri=200k". So any escape character supported in nginx.conf? THANKS.by bigplum - Nginx Mailing List - English
Thanks to Maxim, I make a mistake that do not read the r->out statements. The r->out is NULL, so something goes wrong.by bigplum - Nginx Mailing List - English
Hi, I write a module for file download, but sometimes it will alert "the http output chain is empty while sending to client". And I check the code, it seems that if proxy busy buffer run out, write_filter will always return ngx error. Is that right? In function: ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) line 540: out = NULL; if (bsizeby bigplum - Nginx Mailing List - English
Indeed, I think I could simply delete the init_process from ngx_single_process_cycle to let single process work. Another question, most functions in file win32/ngx_thread.c are not implemented, Is there anything consideration?by bigplum - Nginx Mailing List - English
Hi, In win32 native api file: ngx_process_cycle.c init_process will call ngx_event_timer_init(), but the function ngx_mutex_init() does not implement for win32 now, so ngx_event_timer_mutex will be set to 1. And this function ngx_event_timer_init() will be called again in ngx_worker_thread(). The statement will access a invalid memory: ngx_event_timer_mutex->log = log; Seby bigplum - Nginx Mailing List - English
I checkout the newest code from svn and compiled it by vc, but an exception occurred. So I modified cl option to -MTd compiled again. The windbg shows that CheckBytes function return false when calling ngx_free() at ngx_shmem.c:43. I think that ngx_sprintf must put more than name's alloc size bytes into name, So I use ngx_snprintf to replace ngx_sprintf. The problem disappeared. Is it useful?by bigplum - Nginx Mailing List - English
If we set proxy_store and proxy_cache to off, will nginx cache uploaded files?by bigplum - Nginx Mailing List - English
Hi, I modify the calculation method. Now all the connections with same $vara defined by "limit_traffic_rate_zone" will be record in a queue. Number of the sent byte will be summarized in every cycle to get the last_rate of all "same $vara" connections. for the single connection, rate = (limit - last_rate)/conn + last_rate So that, the first downloading will not beby bigplum - Nginx Mailing List - English
> > Some notes: > > 1. You return NGX_DECLINED from body filter. It's > just wrong. > > 2. You set r->limit_rate dynamically to do actual > rate limiting. > Note that this isn't going to work well as > limit_rate limits > average download rate for request and not expected > to be changed > during downloading. > Thanks a lot.by bigplum - Nginx Mailing List - English
Hello guys: I wrote a module to limit rate by given variable rather than limit_rate by connection. Most code of this module is copied from limit_conn module. I'm confusing to write this new module or modify limit_conn module. The modification will be easily but a new module would be installed easily. So, how about this new module? https://github.com/bigplum/Nginx-limit-traffic-rate-moduleby bigplum - Nginx Mailing List - English