In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Ab pressure test
Command format:
Ab [options] website addresses #-n,-c,-t,-v
Experiment
First, we manually compile and install the Apache service and optimize the web page compression for him, using ab pressure test to compare the difference before and after optimization!
1. Compile and install Apache manually
Details of the process can be found at: https://blog.51cto.com/14557905/2459413
two。 You also need to configure the DNS server, where we modify the hosts file in another way
Insert a few more pictures into the web page for testing
3. Find the ab stress test tool
4. The compression function module is tested in the off state:
Turn on the service and turn off the firewall!
Test:
Second, open the compression module and do the test
Open and complete the test.
Summary: because only do the test page content is very little, so the results of the gap will be a little different, but this is not an accurate result, ab stress test results vary, the need for multiple tests to take the average!
Brief introduction to the working Mode of apache
Apache, as the most widely used and most stable open source server software for web servers, has many working modes. When the source package installs httpd, you can view the httpd-mpm.conf file, which is located in the extare/conf directory.
At present, there are mainly the following modes:
Event mode prefork mode
Worker mode
Switching to working mode requires declaration in configure or modification of the configuration file
[root@localhost bin] # httpd-l / / View apache's current operating mode Compiled in modules:core.cmod_so.chttp_core.cevent.c
Introduction of event working mode
Event is the latest working mode of apache, which is very similar to worker mode, except that it solves the problem that thread resources are wasted during keep-alive long links. Event working mode will fail when it encounters some incompatible modules and will fall back to worker mode.
The event working mode requires epoll support from the Linux system (linux 2.6 +) to enable it. What needs to be added is the link to HTTPS (SSL)
The way event works
In the event working mode, there will be some special threads to manage these keep-alive type threads when there is a real request, pass the request to the server thread, and then allow it to release after execution, so that a thread can handle several requests, realizing asynchronous non-blocking. This enhances request processing in high concurrency scenarios
Event parameter explanation
In the httpd-mpm.conf configuration file, the following is the definition of the prefork module
Event optimization recommendations
Can be debugged according to the production environment to determine the appropriate parameters and optimize the reference.
Introduction of prefork working mode
Prefork is a multiprocessing module (MPM), which implements a process-based, pre-derived web server. It is suitable for systems without thread-safe libraries and need to avoid thread compatibility problems. If each request is independent of each other, it has good characteristics. If there is a problem with one request, it will not affect the strong self-adjustment ability of other requests. Only a few configuration instructions are needed to adjust it to suit enterprise application requirements. The most important thing is to set MaxClient to a value large enough to handle potential request peaks, but not too large, to avoid requiring more memory than physical memory.
In prefork working mode, a single control process (parent process) is responsible for generating child processes. Child processes are used to listen to requests and respond, so there will always be some spare or idle child processes in memory to respond to new requests, which can speed up the response. The parent process usually runs as root to bind port 80, and the child process is usually run as a low-privileged user. The user who runs the child process through the User and Group of the configuration item must have read access to the content of the site. However, you must have as few permissions to other resources as possible to ensure that the system compiles and installs safely without specifying a working mode. Prefork mode is used by default, which can be viewed with httpd-l.
Prefork parameter explanation
In the httod-mpm.conf configuration file, here is the definition of the prefork module
Prefork optimization recommendations
Can be debugged according to the production environment to determine the appropriate parameters and optimize the reference.
Worker mode
The definition of worker in httpd-mpm.conf
Apache directory properties
The permission setting of the directory uses the
< Directory 目录路径>And
< /Directory>This pair of statements to set permissions for the home directory or virtual directory they are a pair of container statements that must appear in pairs, encapsulating specific statements for setting directory permissions, which only work on the set directory and its subdirectories.
Directory property parameters
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.