Index: src/base.h
===================================================================
--- src/base.h	(revision 2296)
+++ src/base.h	(working copy)
@@ -278,6 +278,7 @@
 	unsigned short max_request_size;
 
 	unsigned short kbytes_per_second; /* connection kb/s limit */
+	unsigned short delay_seconds;
 
 	/* configside */
 	unsigned short global_kbytes_per_second; /*  */
@@ -367,6 +368,8 @@
 	chunkqueue *request_content_queue; /* takes request-content into tempfile if necessary [ tempfile, mem ]*/
 
 	int traffic_limit_reached;
+	time_t handle_delayed_time;   /* handling of the connection is delayed to specified time */
+	int handle_delayed;
 
 	off_t bytes_written;          /* used by mod_accesslog, mod_rrd */
 	off_t bytes_written_cur_second; /* used by mod_accesslog, mod_rrd */
Index: src/connections.c
===================================================================
--- src/connections.c	(revision 2296)
+++ src/connections.c	(working copy)
@@ -1381,6 +1381,7 @@
 
 			con->request_count++;
 			con->loops_per_request = 0;
+			con->handle_delayed = 0;
 
 			connection_set_state(srv, con, CON_STATE_READ);
 
Index: src/configfile.c
===================================================================
--- src/configfile.c	(revision 2296)
+++ src/configfile.c	(working copy)
@@ -94,6 +94,7 @@
 		{ "etag.use-inode",             NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 49 */
 		{ "etag.use-mtime",             NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 50 */
 		{ "etag.use-size",             NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_SERVER }, /* 51 */
+		{ "connection.delay-seconds",    NULL, T_CONFIG_SHORT, T_CONFIG_SCOPE_CONNECTION },  /* 52 */
 		{ "server.host",                 "use server.bind instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
 		{ "server.docroot",              "use server.document-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
 		{ "server.virtual-root",         "load mod_simple_vhost and use simple-vhost.server-root instead", T_CONFIG_DEPRECATED, T_CONFIG_SCOPE_UNSET },
@@ -217,6 +218,7 @@
 		cv[49].destination = &(s->etag_use_inode);
 		cv[50].destination = &(s->etag_use_mtime);
 		cv[51].destination = &(s->etag_use_size);
+		cv[52].destination = &(s->delay_seconds);
 
 		srv->config_storage[i] = s;
 
@@ -271,6 +273,7 @@
 #endif
 	PATCH(server_tag);
 	PATCH(kbytes_per_second);
+	PATCH(delay_seconds);
 	PATCH(global_kbytes_per_second);
 	PATCH(global_bytes_per_second_cnt);
 
@@ -362,6 +365,8 @@
 				PATCH(server_tag);
 			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("connection.kbytes-per-second"))) {
 				PATCH(kbytes_per_second);
+			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("connection.delay-seconds"))) {
+				PATCH(delay_seconds);
 			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("debug.log-request-handling"))) {
 				PATCH(log_request_handling);
 			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("debug.log-request-header"))) {
Index: src/response.c
===================================================================
--- src/response.c	(revision 2296)
+++ src/response.c	(working copy)
@@ -293,6 +293,12 @@
 			con->request.http_version = HTTP_VERSION_1_0;
 		}
 
+		if (con->conf.delay_seconds && !con->handle_delayed) {
+			con->handle_delayed_time = srv->cur_ts + con->conf.delay_seconds;
+			con->handle_delayed = 1;
+			return HANDLER_WAIT_FOR_EVENT;
+		}
+
 		switch(r = plugins_call_handle_uri_clean(srv, con)) {
 		case HANDLER_GO_ON:
 			break;
Index: src/server.c
===================================================================
--- src/server.c	(revision 2296)
+++ src/server.c	(working copy)
@@ -1269,6 +1269,11 @@
 						changed = 1;
 					}
 
+					if (con->handle_delayed_time && srv->cur_ts >= con->handle_delayed_time) {
+						con->handle_delayed_time = 0;
+						changed = 1;
+					}
+
 					if (changed) {
 						connection_state_machine(srv, con);
 					}
Index: doc/traffic-shaping.txt
===================================================================
--- doc/traffic-shaping.txt	(revision 2296)
+++ doc/traffic-shaping.txt	(working copy)
@@ -33,6 +33,11 @@
 
   default: 0 (no limit)
 
+:connection.delay-seconds:
+  delay request for specified seconds before handling it
+
+  default: 0 (no delay)
+
 :server.kbytes-per-second:
   limit the throughput for all connections to the given limit
   in kbyte/s
@@ -53,3 +58,6 @@
 
 Keep in mind that a limit below 32kb/s might actually limit the traffic to 32kb/s. This
 is caused by the size of the TCP send buffer.
+
+Be aware that due to timer trigger precision, request handling is delayed for
+connection.delay-seconds +1 or -1 seconds
