When it comes to long links, you must be familiar with the continuous data interaction with a link, unlike those one-night stand-by services that require frequent opening and closing links, low efficiency and increased complexity of the business. In
Nginx.conf Configuration explanation
Detailed user www www; Define the Nginx running user and group Worker_processes 8; #[Debug | info | notice | warn | error | crit] Error_log/data1/logs/nginx_error.log crit; Pid/usr/local/webserver/nginx/nginx.
Both select and Epoll are used to listen for the occurrence of an event on the socket-interface descriptor and to implement I/O multiplexing
Select (poll)
#include
#include
int Select (int maxfdpl, fd_set* readset, fd_set* Writeset, fd_set*
Overview
Epoll is Linux provides a multiplexing technology, similar to each platform to support the Select, but only epoll in the implementation of the kernel to do more optimization, can support more than select File descriptor, of course, also
Nginx installation is complete, the corresponding installation directory will be generated, according to the previous installation path, Nginx's profile path is/opt/nginx/conf, where nginx.conf is the nginx main configuration file. Here is the key
EPOLL-I/O Event Notification Facility
In Linux network programming, it is a long time to use Select to do event triggering. In the new Linux kernel, there is a mechanism to replace it, which is epoll.
The biggest advantage over Select,epoll is
Before we talk about most of the server and the client side of the technology, the development of servers in fact sometimes involves access to the server, such as Tencent's Pat server needs to know the login member information, you need to visit the
Nginx Introduction and Installation
One, why does nginx support high concurrency? The difference between Epoll and select
When developing high-performance Web programs, Windows developers will say that iocp,linux developers say they will epoll.
Why is the performance of nginx much higher than Apache?
This is mainly because Nginx uses the latest epoll (Linux 2.6 kernel) and Kqueue (FreeBSD) network I/O models, while Apache uses the traditional select model. I've seen an example of this in
One, select
The select is currently supported on almost all platforms, and its good cross-platform support is one of its advantages, and it is, in fact, one of the few advantages it has left.
One disadvantage of select is that the number of file
Tornado is a "suite" of Open-source servers for Facebook, designed to do the Python Web or use its own extensible functionality to complete an incomplete WSGI protocol that can be used for fast web development, encapsulating epoll performance better.
Introduction of Epoll Series functions
#include
int epoll_create (int size);
int epoll_create1 (int flags);
int epoll_ctl (int epfd, int op, int fd, struct epoll_event *event);
int epoll_wait (int epfd, struct epoll_event *events, int
The system ran for a long time, there will always be such a problem and bottlenecks, there are problems not scary, we have the "tiger" thing--nothing more than the positioning problem-> analysis-> put forward solutions-> practice-> Results Feedback->
If the reader has done web development before, you should know how to build a Web server to run your Web site, under Windows you may choose to use IIS, very fast, under Linux, you may first think of Apache, "one Brother" ( W3TECHS site data ranking)
View the parameters of some common services at compile-time installation:
1.Nginx compile-time parameters for installation
[Root@test ~]#/usr/local/nginx/sbin/nginx-v
Nginx version:nginx/0.7.65
Built by GCC 4.1.2 20080704 (Red Hat 4.1.2-48)
TLS
Epoll efficient mechanism is actually the kernel callback, we know that Linux socket is also treated as file, but the underlying driver is not the same.
Let's take a look at the kernel file structure:
struct File_operations {
struct
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.