Problems encountered during varnish usage
1: Install varnish3. Varnish2 and varnish3 have different parameters! Varnish2.x and varnish3.x have different compilation parameters!
Execute autogen. sh first, and an error is returned!
Solution:
It prompts that automake and yum-y install automake are not found!
Run autogen. sh again. The error is as follows:
Solution:
Yum-y install libtool
Then execute sh autogen. sh!
Description:
Libtool is a common library that supports scripts. It hides the complexity of dynamic libraries in a unified and portable interface.
The next step is configure:
./Configure -- enable-debugging-symbols -- enable-developer-warnings -- enable-dependency-tracking -- prefix =/usr/local/varnish3
Make
Make install
The system prompts that the pcre cannot be found. See the attachment!
Solution: Yum-y install pcre-devel
2: The file descriptor is too small, leading to varnish startup failure.
Solution: ulimit-HSn 65535: Adjust the file descriptor.
3: May 6 16:50:34 varnish2/data/varnish/cache [2144]:-T 192.168.2.185: 3500 cocould not be listened on. cause: Although varnish didn't start listening on port 80, it started at Port 3500, so the above prompt is similar when varnish is started again.
Solution:
Lsof-I: 3500
Kill the corresponding pid
Then restart!
4: varnish finally solves the problem regardless of whether it is sent. The reason is: the configuration file contains the following Configuration:
In my testing environment (the Environment virtualized on my machine) I use www.abc.com for testing, so it must be normal! However, in another test environment, I only modified the addresses and ports of web2 and web3, but did not modify the configuration of www.test.com!
It can be changed to the following!
# If you do not modify the related content of www.test.com, after www.test.com is resolved to varnish, varnish will always access this machine no matter whether the background machine is down or not!
This is a waste of two days! # Carelessly killing people
5: Create worker thread failed 11 Resource temporarily unavailable cause: When varnishd is started,
Ulimit-SHn 65535
/Usr/local/varnish/sbin/varnishd-f/usr/local/varnish/etc/varnish/default. vcl-a 192.168.2.184: 80-u varnish-g varnish-n/data/varnish/cache-p thread_pool_max = 5000-pthread_pools = 1-h classic, 500009-p lru_interval = 20-p listen_depth = 1024-s malloc, 512 M-w 3500, 10-T 192.168.2.184:
Pay attention to the red font part. When I set it to 2, the above error is generated. The problem can be solved by modifying it to 1. The main reason is that I tested it using vm, and I only had one cpu! So the above error will be reported!