本課程將爲你講解如何在生產環境下對Java應用作性能監控與調優;經過本課程,你將掌握多種性能監控工具應用,學會定位並解決諸如內存溢出、cpu負載飆高等問題;學會線上代碼調試,Tomcat、Nginx,GC調優等手段; 讀懂JVM字節碼指令,分析源碼背後原理,提高應對線上突發情況的能力html
適合人羣
具有至少一個項目開發和上線經驗的同窗
想學習生產環境下應用監控與調優技術的同窗
想提升解決生產環境的各類性能問題的能力的同窗
正準備晉級Java中高級工程師的同窗java
技術儲備要求
有Java,Linux,Tomcat,Nginx等
Java初中級工程師必備技術基礎web
package com.yky.logic.test;
import java.io.File;
import org.apache.catalina.core.AprLifecycleListener;
import org.apache.catalina.core.StandardServer;
import org.apache.catalina.startup.Tomcat;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
/**apache
- TOMCAT
*/
public class EmbeddedTomcat {
private final Logger log = LogManager.getLogger(EmbeddedTomcat.class);
private static String CONTEXT_PATH = "/cis";
private static String PROJECT_PATH = System.getProperty("user.dir");
private static String WEB_APP_PATH = PROJECT_PATH + File.separatorChar + "src/main/webapp";
private static int PORT = 8080;
private Tomcat tomcat = new Tomcat();
public void start() throws Exception {
tomcat.setPort(PORT);
tomcat.setBaseDir(WEB_APP_PATH);
tomcat.getHost().setAppBase(WEB_APP_PATH);
StandardServer server = (StandardServer) tomcat.getServer();
AprLifecycleListener listener = new AprLifecycleListener();
server.addLifecycleListener(listener);
tomcat.addWebapp(CONTEXT_PATH, WEB_APP_PATH);
tomcat.enableNaming();
tomcat.start();
tomcat.getServer().await();
log.info("============== Tomcat 啓動 ==============");
}
public void stop() throws Exception {
tomcat.stop();
log.info("============== Tomcat 終止 ==============");
}
/
- @param args
- @throws Exception*/public static void main(String[] args) throws Exception {EmbeddedTomcat embededTomcat = new EmbeddedTomcat();embededTomcat.start();}