Coris

来自ling
跳转至: 导航搜索

poc

druid连接数优化

-Ddruid.initialSize=100 -Ddruid.minIdle=100 -Ddruid.maxActive=200

线程池优化

@Configuration
public class AsyncConfig {

    @Bean
    public Executor rule24QueryAsyncPool() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        //参考cpu数量设置
        executor.setCorePoolSize(8); //核心线程数
        executor.setMaxPoolSize(16);  //最大线程数
        executor.setQueueCapacity(200); //队列大小
        executor.setKeepAliveSeconds(200); //线程最大空闲时间
        executor.setThreadNamePrefix("async-Executor-rule24Query");
        executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); // 拒绝策略(一共四种,此处省略)
        executor.initialize();
        return executor;
    }
}

数据库优化 Docker常用服务#修改连接数

oracle

表空间

CREATE SMALLFILE TABLESPACE "BL_MAINT"
DATAFILE '/u01/app/oracle/BL_MAINT.dbf'
SIZE 100M AUTOEXTEND ON NEXT 2048K MAXSIZE UNLIMITED
LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

create user BL_MAINT identified by BL_MAINT default tablespace BL_MAINT;
grant connect,resource to BL_MAINT;
grant dba to BL_MAINT;

CREATE SMALLFILE TABLESPACE "DBCRSEX_MAINT"
DATAFILE '/u01/app/oracle/DBCRSEX_MAINT.dbf'
SIZE 100M AUTOEXTEND ON NEXT 2048K MAXSIZE UNLIMITED
LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

create user DBCRSEX_MAINT identified by DBCRSEX_MAINT default tablespace DBCRSEX_MAINT;
grant connect,resource to DBCRSEX_MAINT;
grant dba to DBCRSEX_MAINT;

CREATE SMALLFILE TABLESPACE "TS_CRSEX"
DATAFILE '/u01/app/oracle/TS_CRSEX.dbf'
SIZE 100M AUTOEXTEND ON NEXT 2048K MAXSIZE UNLIMITED
LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;

create user TS_CRSEX identified by TS_CRSEX default tablespace TS_CRSEX;
grant connect,resource to TS_CRSEX;
grant dba to TS_CRSEX;