| 102 | * 將 Tomcat 的 Keepalive 降低 - /opt/crawlzilla/tomcat/conf/server.xml |
| 103 | {{{ |
| 104 | ## 編輯 /opt/crawlzilla/tomcat/conf/server.xml |
| 105 | <Service name="Catalina"> |
| 106 | |
| 107 | <Connector port="8080" protocol="HTTP/1.1" |
| 108 | keepAliveTimeout="100" |
| 109 | connectionTimeout="100" |
| 110 | }}} |
| 111 | * 減少同時 Apache process 的個數 - MaxClients 改成 2 - /etc/apache2/apache2.conf |
| 112 | {{{ |
| 113 | <IfModule mpm_event_module> |
| 114 | StartServers 1 |
| 115 | MinSpareThreads 1 |
| 116 | MaxSpareThreads 1 |
| 117 | ThreadLimit 1 |
| 118 | ThreadsPerChild 1 |
| 119 | MaxClients 2 |
| 120 | MaxRequestsPerChild 20 |
| 121 | </IfModule> |
| 122 | }}} |
| 123 | * 縮短 Timeout 時間 |
| 124 | {{{ |
| 125 | # |
| 126 | # Timeout: The number of seconds before receives and sends time out. |
| 127 | # |
| 128 | Timeout 10 |
| 129 | |
| 130 | # |
| 131 | # KeepAlive: Whether or not to allow persistent connections (more than |
| 132 | # one request per connection). Set to "Off" to deactivate. |
| 133 | # |
| 134 | KeepAlive On |
| 135 | |
| 136 | # |
| 137 | # MaxKeepAliveRequests: The maximum number of requests to allow |
| 138 | # during a persistent connection. Set to 0 to allow an unlimited amount. |
| 139 | # We recommend you leave this number high, for maximum performance. |
| 140 | # |
| 141 | MaxKeepAliveRequests 50 |
| 142 | |
| 143 | # |
| 144 | # KeepAliveTimeout: Number of seconds to wait for the next request from the |
| 145 | # same client on the same connection. |
| 146 | # |
| 147 | KeepAliveTimeout 2 |
| 148 | }}} |