column read and write command must have an interval with the row valid command, this interval is defined as TRCD, that is, RAS to CAS delay (RAS to CAS latency), this is very well understood, After the address line to send the line address, to wait until the line address stable positioning and then send the address, TRCD is an important time parameter of SDRAM, the relevant values refer to the corresponding chip hardware manual. Usually trcd in the number of clock
compare the algorithms by the number of cycles.2. Exchange Law:The procedure for exchanging is the clearest and simplest, which is compared and exchanged each time with the following elements of the current element one by one.
Copy Code code as follows:
#include void Exchangesort (int* pdata,int Count)
{
int itemp;
for (int i=0;i{
for (int j=i+1;j{
if (Pdata[j]{
itemp = PData;
PData = Pdata[j];
PDATA[J] = itemp;
}
}
Installing HTTPD version 2.2#yum Install httpd#cd/usr/lib64/httpd/modules/#ls-requires Apache to have loaded modules such as Mod_proxy, Mod_proxy_http, MOD_PROXY_AJP, and Proxy_balancer_module (for use with Tomcat clusters)#cd/etc/httpd/conf/#vi proxy.confProxyvia onProxyrequests offProxypreservehost onproxypass/http://localhost:8080/or ajp://localhost:8009/proxypassreverse/http://localhost:8080/or ajp://lo
In the actual production, Tomcat server is generally not used alone in the project, the response to static resources Nginx performance is better, in addition, because Nginx is dedicated to reverse proxy server, it is easy to implement the Java request forwarded to the back end to the Tomcat container processing, And itself is used to handle static resources.Usually the Tomcat front end is Nginx or Apache, the back end is Tomcat, also means that no matter what the front-end is the role of the age
port of JK2 connector to 11009, the content of the entire file is as follows:
#++++++++++++++ channelSocket.port=11009 #++++++++++++++
To run two Tomcat servers on one machine, modify the Tomcat Stop command listening port of server. conf:
Change
Then open JK2 AJP Connector and close other connector. The following figure shows JK2 AJP 1.3. Here, we have changed its port t
/bin
Esc, shift + Z, exit and save.
For the configuration file to take effect, enter the command: source/etc/profile
OK. Check whether the configuration is successful.
The path is printed successfully. environment variables are configured successfully!
5. Run our JBOSS
You only need to enter the bin directory of JBoss and execute run. sh. It takes about 40 s
Unfortunately, CentOS uses the command method and can be tested without a browser. By default, JBoss only listens to localhost, so it can
requests that can be placed in the processing queue when all the threads that can be used to process the request are used, and requests that exceed this number will not be processedThis is an optimization of the HTTP connector, and if you use Apache and Tomcat to load balance the cluster and use the AJP protocol for Apache and Tomcat protocol forwarding, you also need to optimize the AJP connector.connecti
The integration of Tomcat and Apache has the following advantages:
1. Use Apache for load balancing and fault tolerance;
2. Apache focuses on static Web page parsing and tomcat focuses on dynamic web page parsing, which can improve server efficiency;
3. Applications can be upgraded seamlessly.
First install Apache and Tomcat and install the mod_jk (SUDO apt-getinstall libapache2-mod-jk ).
I. AJP Connector
Tomcat 6 provides the
reliably determine the server's fully qualified domain name, using 127.0.1.1 for servernameEnter http: // 127.0.0.1/in the browser to view it works! B. start installing mod_proxy.so and mod_proxy_ajp.so, mod_proxy_balancer.so module CD/opt/Apache/httpd-2.2.21/modules/Proxy/opt/web/apache2/bin/apxs-I-a-c mod_proxy.c proxy_util.c/opt/web/apache2/bin/ apxs-I-a-c mod_proxy_ajp.c AJP *. c/opt/web/apache2/bin/apxs-I-a-c mod_proxy_balancer.cc. configure htt
Let's Encrypt + Apache + Tomcat for free HTTPS and encrypttomcat
Let's Encrypt is a free SSL Certificate release project. The issued certificate has been supported by mainstream browsers, including Google browser (desktop edition) and Firefox browser (desktop edition) UC browser (mobile edition), 360 browser (mobile edition) support, other are not tested yet;
This article explains how to use Let's Encrypt to obtain a free SSL Certificate, configure the SSL feature of apache, and forward requests
It was originally installed with APT-Get on Ubuntu apache2, but how can not be integrated with Tomcat 5, there are a lot of online Introduction, basically is the use of mod_jk-apache-2.2.4.so, through it to forward requests to Tomcat, according to the following post, I have fully configured it (because it won't compile, so I searched this post to directly compile the mod_jk version): Apache and tomcat integration, however, after running, apache2 does not distribute requests to Tomcat.
Then, reco
high-performance HTTP connector you want.1 connector introduces 1.1 Connector types
The connector-related classes in Tomcat source code are located in the org. Apache. Coyote package. connector is divided into the following categories:
HTTP ctor Ctor is responsible for establishing HTTP connections based on the HTTP protocol. It can be divided into bio HTTP ctor AND NiO HTTP connector. The latter provides support for non-blocking Io and persistent connection comet.
Based on the
Tomcat source code analysis (startup Framework)
Preface:
This article is some of my experiences after reading the Tomcat source code. It mainly explains the Tomcat System Framework and startup process. If you have any mistakes, please criticize them!
Suggestion:
After all, the Tomcat framework is still complicated. It is not easy to grasp the Tomcat framework simply by understanding the text. Therefore, you must practice, practice, and practice again. We recommend that you download the Tomca
Modify the port number when multiple tomcat servers are deployed on the same server. tomcat details
When multiple tomcat servers are deployed on the same server, port numbers conflict. Therefore, you must modify the tomcat configuration file server. xml. Take tomcat 7 as an example.
First, let's take a look at the main tomcat ports:
8080 is the HTTP port and 8443 is the HTTPS port.
8005 indicates the remote service Stop port
8009 is the AJP
/httpd in the Apache installation directory. conf file, remove the annotator (#) before the following text so that Apache can automatically load the proxy module at startup 。
Copy codeThe Code is as follows: LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_
/
# cd srclib/apr
# ./configure --prefix=/usr/local/apr
# make
# make install
# cd ../apr-util
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make
# make install
# cd ../..
# ./configure --prefix=/usr/local/apache2 --enable-so --enable-mods-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-dav --enable-proxy --enable-proxy-ajp
# make
# make install
Start httpd and
under tags
--
Valve className="Com.radiadesign.catalina.session.RedisSessionHandlerValve" />
Manager className="Com.radiadesign.catalina.session.RedisSessionManager"
host="127.0.0.1"
Port="6379"
Password="root"
Database="0"
maxinactiveinterval="3600"/>
The provided configuration does not have the Password property by default. We can view the Tomcat-redis-session-manager-1.2-tomcat-6.jar source code, the password attribute that can be found in Redissessionmanager.class.650)
available.Localhost_access_log.2016-06-24.txt is a user access logCatalina.out Program Startup logTemp is the temp file directoryWebApps application DirectoryTuningIn the first line of the catalina.sh file, add the following codejava_opts= '-xms2048m-xmx2048m 'or this line.Java_opts= '-dfile.encoding=utf-8-server-xms1024m-xmx2048m-xx:newsize=512m-xx:maxnewsize=1024m-xx:permsize=256m -XX:MAXPERMSIZE=256M-XX:MAXTENURINGTHRESHOLD=10-XX:NEWRATIO=2-XX:+DISABLEEXPLICITGC 'The default bio mode, which
Ajp13jkmount/* ControllerThis configuration Jkmoun/* Controller indicates that all Apache requests are turned to Tomcat. Then edit a file as follows:Workers.properties# # workers.properties# # list the workers by nameworker.list=controllerworker.controller.type= Lbworker.controller.sticky_session=1worker.controller.error_escalation_time=0worker.controller.max_reply_ timeouts=10 # localhost Server #------------------------worker.jvm1.reference=worker.templateworker.jvm1.port= 8019 #对应tomcat
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.