view misc/GNUmakefile @ 4207:4fc91bae6f83

Better recheck of dead upstream servers. Previously nginx used to mark backend again as live as soon as fail_timeout passes (10s by default) since last failure. On the other hand, detecting dead backend takes up to 60s (proxy_connect_timeout) in typical situation "backend is down and doesn't respond to any packets". This resulted in suboptimal behaviour in the above situation (up to 23% of requests were directed to dead backend with default settings). More detailed description of the problem may be found here (in Russian): http://mailman.nginx.org/pipermail/nginx-ru/2011-August/042172.html Fix is to only allow one request after fail_timeout passes, and mark backend as "live" only if this request succeeds. Note that with new code backend will not be marked "live" unless "check" request is completed, and this may take a while in some specific workloads (e.g. streaming). This is believed to be acceptable.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 12 Oct 2011 14:22:48 +0000
parents 871229f8173c
children effc7962aebe
line wrap: on
line source


VER =		$(shell grep 'define NGINX_VERSION' src/core/nginx.h	\
			| sed -e 's/^.*\"\(.*\)\"/\1/')
NGINX =		nginx-$(VER)
TEMP =		tmp
REPO =		svn://svn.nginx.com

OBJS =		objs.msvc8
OPENSSL =	openssl-1.0.0d
ZLIB =		zlib-1.2.3
PCRE =		pcre-7.9


RELEASE:
	test -d $(TEMP) || mkdir -p $(TEMP)

	echo "nginx-$(VER)-RELEASE" > $(TEMP)/message
	svn ci -F $(TEMP)/message

	echo "release-$(VER) tag" > $(TEMP)/message
	svn copy $(REPO)/nginx/trunk $(REPO)/nginx/tags/release-$(VER)  \
		-F $(TEMP)/message

	svn up

	$(MAKE) release


release:
	rm -rf $(TEMP)

	svn export -rHEAD . $(TEMP)/$(NGINX)

	mv $(TEMP)/$(NGINX)/auto/configure $(TEMP)/$(NGINX)

	# delete incomplete sources
	rm $(TEMP)/$(NGINX)/src/event/ngx_event_acceptex.c
	rm $(TEMP)/$(NGINX)/src/event/ngx_event_connectex.c
	rm $(TEMP)/$(NGINX)/src/event/modules/ngx_iocp_module.*
	rm -r $(TEMP)/$(NGINX)/src/os/win32

	rm -r $(TEMP)/$(NGINX)/src/mysql

	rm $(TEMP)/$(NGINX)/src/http/modules/ngx_http_status_module.c

	mv $(TEMP)/$(NGINX)/docs/text/LICENSE $(TEMP)/$(NGINX)
	mv $(TEMP)/$(NGINX)/docs/text/README $(TEMP)/$(NGINX)
	mv $(TEMP)/$(NGINX)/docs/html $(TEMP)/$(NGINX)
	mv $(TEMP)/$(NGINX)/docs/man $(TEMP)/$(NGINX)

	$(MAKE) -f docs/GNUmakefile changes

	# delete incomplete draft documentation
	rm -r $(TEMP)/$(NGINX)/html/http

	rm -r $(TEMP)/$(NGINX)/docs
	rm -r $(TEMP)/$(NGINX)/misc

	tar -c -z -f $(NGINX).tar.gz --directory $(TEMP) $(NGINX)


snapshot:
	rm -rf $(TEMP)

	mkdir -p $(TEMP)
	svn export . $(TEMP)/$(NGINX)

	mv $(TEMP)/$(NGINX)/auto/configure $(TEMP)/$(NGINX)

	# delete incomplete sources
	rm $(TEMP)/$(NGINX)/src/event/ngx_event_acceptex.c
	rm $(TEMP)/$(NGINX)/src/event/ngx_event_connectex.c
	rm $(TEMP)/$(NGINX)/src/event/modules/ngx_iocp_module.*
	rm -r $(TEMP)/$(NGINX)/src/os/win32

	rm -r $(TEMP)/$(NGINX)/src/mysql

	rm $(TEMP)/$(NGINX)/src/http/modules/ngx_http_status_module.c

	mv $(TEMP)/$(NGINX)/docs/text/LICENSE $(TEMP)/$(NGINX)
	mv $(TEMP)/$(NGINX)/docs/text/README $(TEMP)/$(NGINX)
	mv $(TEMP)/$(NGINX)/docs/html $(TEMP)/$(NGINX)
	mv $(TEMP)/$(NGINX)/docs/man $(TEMP)/$(NGINX)

	$(MAKE) -f docs/GNUmakefile changes

	rm -r $(TEMP)/$(NGINX)/docs
	rm -r $(TEMP)/$(NGINX)/misc

	tar -c -z -f $(NGINX).tar.gz --directory $(TEMP) $(NGINX)


zip:
	rm -rf $(TEMP)
	rm -f $(NGINX).zip

	mkdir -p $(TEMP)/$(NGINX)/docs
	mkdir -p $(TEMP)/$(NGINX)/logs
	mkdir -p $(TEMP)/$(NGINX)/temp

	svn export -rHEAD conf $(TEMP)/$(NGINX)/conf/
	perl -pi -e 's/$$/\r/' $(TEMP)/$(NGINX)/conf/*

	svn export -rHEAD contrib $(TEMP)/$(NGINX)/contrib/
	svn export -rHEAD docs/html $(TEMP)/$(NGINX)/html/

	# delete incomplete draft documentation
	rm -r $(TEMP)/$(NGINX)/html/http

	$(MAKE) -f docs/GNUmakefile changes

	cp -p $(OBJS)/nginx.exe $(TEMP)/$(NGINX)

	cp -p docs/text/LICENSE $(TEMP)/$(NGINX)/docs/
	cp -p docs/text/README $(TEMP)/$(NGINX)/docs/
	mv $(TEMP)/$(NGINX)/CHANGES* $(TEMP)/$(NGINX)/docs/

	cp -p $(OBJS)/lib/$(OPENSSL)/LICENSE				\
		$(TEMP)/$(NGINX)/docs/OpenSSL.LICENSE

	cp -p $(OBJS)/lib/$(PCRE)/LICENCE				\
		$(TEMP)/$(NGINX)/docs/PCRE.LICENCE

	perl -ne 'print if /^ \(C\) 1995-2004/ .. /^  jloup\@gzip.org/'	\
		$(OBJS)/lib/$(ZLIB)/README				\
		> $(TEMP)/$(NGINX)/docs/zlib.LICENSE

	touch -r $(OBJS)/lib/$(ZLIB)/README				\
		$(TEMP)/$(NGINX)/docs/zlib.LICENSE

	cd $(TEMP) && zip -r ../$(NGINX).zip $(NGINX)


icons:	src/os/win32/nginx.ico

# 48x48, 32x32 and 16x16 icons

src/os/win32/nginx.ico:	src/os/win32/nginx_icon48.xpm			\
			src/os/win32/nginx_icon32.xpm			\
			src/os/win32/nginx_icon16.xpm

	test -d $(TEMP) || mkdir $(TEMP)

	xpmtoppm --alphaout=$(TEMP)/nginx48.pbm				\
		src/os/win32/nginx_icon48.xpm > $(TEMP)/nginx48.ppm

	xpmtoppm --alphaout=$(TEMP)/nginx32.pbm				\
		src/os/win32/nginx_icon32.xpm > $(TEMP)/nginx32.ppm

	xpmtoppm --alphaout=$(TEMP)/nginx16.pbm				\
		src/os/win32/nginx_icon16.xpm > $(TEMP)/nginx16.ppm

	ppmtowinicon -output src/os/win32/nginx.ico -andpgms		\
		$(TEMP)/nginx48.ppm $(TEMP)/nginx48.pbm			\
		$(TEMP)/nginx32.ppm $(TEMP)/nginx32.pbm			\
		$(TEMP)/nginx16.ppm $(TEMP)/nginx16.pbm