cnken / substitutions4nginx

Automatically exported from code.google.com/p/substitutions4nginx
3 stars 3 forks source link

页面较大的时候会报segmentation fault nainx会中断 #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
超过400行的时候,多刷新几次页面nginx就会报错退出
页面如果更大超过1000行,只要一访问nginx就会报错退出

location / {
root   /mnt/disk1/webserver/www;
            index  index.html index.htm;
subs_filter_types text/html text/css;
subs_filter nginx nginx.example.com;    
        }

操作系统是
CentOS release 5.4 (Final)
nginx-0.8.36
pcre-8.02

ngx_http_subs_filter_module.c
r18

Original issue reported on code.google.com by sunta...@gmail.com on 13 May 2010 at 7:33

Attachments:

GoogleCodeExporter commented 9 years ago
你可以给我一个debug日志吗,我用你的index1.html来下载,都没�
��问题。谢谢

Original comment by yaoweibin@gmail.com on 13 May 2010 at 8:04

GoogleCodeExporter commented 9 years ago
这是debug日志和配置文件

Original comment by sunta...@gmail.com on 13 May 2010 at 12:17

Attachments:

GoogleCodeExporter commented 9 years ago
试一下最新的代码,应该解决了你的问题,谢谢你帮我了解��
�长时间没有搞懂的代码。

Original comment by yaoweibin@gmail.com on 14 May 2010 at 4:03

GoogleCodeExporter commented 9 years ago
谢谢,确实不会报错了,但是如果页面比较复杂,替换特别慢,比�
��我要替换www.163.com的首页中的以
//img开头的页面,打开超慢,有没有办法解决呢
subs_filter (//img) $1example gri;

Original comment by sunta...@gmail.com on 16 May 2010 at 2:18

GoogleCodeExporter commented 9 years ago
1.这个替换以后都是错误的uri,会影响速度吧。

2.由于模块是对于页面按行来扫描的,对于大页面来说,速度
很难提高,你可以试着在替换的nginx
前面加一个cache,应该可以提高并发度的。

Original comment by yaoweibin@gmail.com on 17 May 2010 at 3:22

GoogleCodeExporter commented 9 years ago
用nginx自带的那个模块替换确实很快,基本感觉不到延时,是不�
��正则表达式的算法执行效率太低呢?
sub_filter //img http://imgexample;      
sub_filter_once off;

Original comment by sunta...@gmail.com on 17 May 2010 at 6:03

GoogleCodeExporter commented 9 years ago
一方面是正则的原因;另外一方面是它本身的模块只管简单��
�字符串查找插入,而不需要额外分配
内存。而我的模块需要找出每行,而后进行查找替换。

Original comment by yaoweibin@gmail.com on 17 May 2010 at 6:07

GoogleCodeExporter commented 9 years ago
我是在服务器上测试的,服务器的性能很好是新买的,一个页面
也就不到1M的本本,按理说是不应该那么慢的,很
奇怪

Original comment by sunta...@gmail.com on 18 May 2010 at 12:13

GoogleCodeExporter commented 9 years ago
恩,我尝试profile一下看看。

Original comment by yaoweibin@gmail.com on 18 May 2010 at 2:14

GoogleCodeExporter commented 9 years ago
svn co https://substitutions4nginx.googlecode.com/svn/branches/dev
试试最新的开发版本,我做了很多优化工作。

Original comment by yaoweibin@gmail.com on 13 Jun 2010 at 6:28

GoogleCodeExporter commented 9 years ago
感谢,果然快了很多

Original comment by sunta...@gmail.com on 22 Jun 2010 at 2:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
请问支持反向代理的输出内容替换吗?

proxy_pass http://192.168.1.50:9090;
subs_filter_types text/html text/css;
subs_filter nginx nginx.example.com; 
              }

Original comment by sword.ch...@gmail.com on 6 Apr 2011 at 12:34

GoogleCodeExporter commented 9 years ago
支持

Original comment by yaoweibin@gmail.com on 6 Apr 2011 at 12:35

GoogleCodeExporter commented 9 years ago
果然可以,光reload不成,必须重启配置才生效,谢谢了

Original comment by sword.ch...@gmail.com on 6 Apr 2011 at 4:16