Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
668ac901
Commit
668ac901
authored
May 09, 2016
by
Jason Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust accept-count property name
parent
33c4df42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
TomcatContainerCustomizer.java
...ctrip/apollo/biz/customize/TomcatContainerCustomizer.java
+7
-2
EntityManagerUtil.java
...in/java/com/ctrip/apollo/biz/utils/EntityManagerUtil.java
+3
-0
application.properties
apollo-biz/src/main/resources/application.properties
+1
-1
No files found.
apollo-biz/src/main/java/com/ctrip/apollo/biz/customize/TomcatContainerCustomizer.java
View file @
668ac901
...
...
@@ -3,6 +3,8 @@ package com.ctrip.apollo.biz.customize;
import
org.apache.catalina.connector.Connector
;
import
org.apache.coyote.ProtocolHandler
;
import
org.apache.coyote.http11.Http11NioProtocol
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer
;
...
...
@@ -16,7 +18,8 @@ import org.springframework.stereotype.Component;
*/
@Component
public
class
TomcatContainerCustomizer
implements
EmbeddedServletContainerCustomizer
{
private
static
final
String
TOMCAT_ACCEPTOR_COUNT
=
"server.tomcat.acceptor-count"
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
TomcatContainerCustomizer
.
class
);
private
static
final
String
TOMCAT_ACCEPTOR_COUNT
=
"server.tomcat.accept-count"
;
@Autowired
private
Environment
environment
;
...
...
@@ -36,7 +39,9 @@ public class TomcatContainerCustomizer implements EmbeddedServletContainerCustom
ProtocolHandler
handler
=
connector
.
getProtocolHandler
();
if
(
handler
instanceof
Http11NioProtocol
)
{
Http11NioProtocol
http
=
(
Http11NioProtocol
)
handler
;
http
.
setBacklog
(
Integer
.
parseInt
(
environment
.
getProperty
(
TOMCAT_ACCEPTOR_COUNT
)));
int
acceptCount
=
Integer
.
parseInt
(
environment
.
getProperty
(
TOMCAT_ACCEPTOR_COUNT
));
http
.
setBacklog
(
acceptCount
);
logger
.
info
(
"Setting tomcat accept count to {}"
,
acceptCount
);
}
}
...
...
apollo-biz/src/main/java/com/ctrip/apollo/biz/utils/EntityManagerUtil.java
View file @
668ac901
package
com
.
ctrip
.
apollo
.
biz
.
utils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.orm.jpa.EntityManagerFactoryAccessor
;
import
org.springframework.orm.jpa.EntityManagerFactoryUtils
;
import
org.springframework.orm.jpa.EntityManagerHolder
;
...
...
@@ -11,6 +13,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
*/
@Component
public
class
EntityManagerUtil
extends
EntityManagerFactoryAccessor
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
EntityManagerUtil
.
class
);
/**
* close the entity manager.
* Use it with caution! This is only intended for use with async request, which Spring won't
...
...
apollo-biz/src/main/resources/application.properties
View file @
668ac901
...
...
@@ -9,4 +9,4 @@ spring.jpa.hibernate.globally_quoted_identifiers=true
spring.jpa.properties.hibernate.globally_quoted_identifiers
=
true
# Tomcat configuration
server.tomcat.accept
or
-count
=
1024
server.tomcat.accept-count
=
1024
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment