public boolean isLowResources() { if (_threadPool != null) return _threadPool.isLowOnThreads(); return _server.getThreadPool().isLowOnThreads(); }
public boolean isLowResources() { if (_threadPool != null) return _threadPool.isLowOnThreads(); return _server.getThreadPool().isLowOnThreads(); }
public boolean isLowResources() { if (_threadPool != null) return _threadPool.isLowOnThreads(); return _server.getThreadPool().isLowOnThreads(); }
public boolean isLowResources() { if (_threadPool != null) return _threadPool.isLowOnThreads(); return _server.getThreadPool().isLowOnThreads(); }
public boolean isLowResources() { if (_threadPool != null) return _threadPool.isLowOnThreads(); return _server.getThreadPool().isLowOnThreads(); }
private static void checkSufficientThreads(Connector connector, String name) { if (connector == null) { return; } Executor executor = connector.getExecutor(); if (executor instanceof ThreadPool) { ThreadPool queuedThreadPool = (ThreadPool) executor; checkState(!queuedThreadPool.isLowOnThreads(), "insufficient threads configured for %s connector", name); } }
@Override public boolean isJettyCQSRequestHandlerPoolLowOnThreads() { return CMB.cqsServer.getThreadPool().isLowOnThreads(); }
@Override public boolean isJettyCNSRequestHandlerPoolLowOnThreads() { return CMB.cnsServer.getThreadPool().isLowOnThreads(); }
@Override public boolean isLowOnResources() { ThreadPool serverThreads = _server.getThreadPool(); if (serverThreads.isLowOnThreads()) { reason="Server low on threads: "+serverThreads; return true; } return false; }
@PostConstruct public void start() throws Exception { server.start(); checkState(server.isStarted(), "server is not started"); // The combination of an NIO connector and an insufficient number of threads results // in a server that hangs after accepting connections. Jetty scales the number of // required threads based on the number of available processors in a non-trivial way, // so a config that works on one machine might fail on a larger machine without an // obvious reason why. Thus, we need this runtime check after startup as a safeguard. checkSufficientThreads(httpConnector, "HTTP"); checkSufficientThreads(httpsConnector, "HTTPS"); checkSufficientThreads(adminConnector, "admin"); checkState(!server.getThreadPool().isLowOnThreads(), "insufficient threads configured for server connector"); }
/** * Retrieve a summary of activity. * * @return String. JSON based stats of server performance. */ public static String getSummary() throws Exception { setSummaryStats(); Map m = new HashMap(); m.put("stopped", stopped); m.put("loglevel", Configuration.getInstance().logLevel); m.put("ncampaigns", campaigns.size()); m.put("qps", qps); m.put("deltax", avgx); m.put("nobidreason", Configuration.getInstance().printNoBidReason); m.put("cpu", Performance.getCpuPerfAsString()); m.put("memUsed", Performance.getMemoryUsed()); m.put("cores", Performance.getCores()); m.put("diskFree", Performance.getPercFreeDisk()); m.put("openfiles", Performance.getOpenFileDescriptorCount()); m.put("exchanges", BidRequest.getExchangeCounts()); m.put("lowonthreads", server.getThreadPool().isLowOnThreads()); m.put("instance", Configuration.instanceName); return DbTools.mapper.writeValueAsString(m); }
@Override public boolean isLowOnResources() { ThreadPool serverThreads = _server.getThreadPool(); if(serverThreads.isLowOnThreads()) { reason ="Server low on threads: "+serverThreads.getThreads()+", idleThreads:"+serverThreads.getIdleThreads(); return true; } for(Connector connector : getMonitoredConnectors()) { Executor executor = connector.getExecutor(); if (executor instanceof ThreadPool && executor!=serverThreads) { ThreadPool connectorThreads=(ThreadPool)executor; if (connectorThreads.isLowOnThreads()) { reason ="Connector low on threads: "+connectorThreads; return true; } } } return false; }
if (_monitorThreads && threadpool.isLowOnThreads())
if (_monitorThreads && threadpool.isLowOnThreads())
if (_monitorThreads && threadpool.isLowOnThreads())
@Override protected void doStart() throws Exception { if (_server == null) throw new IllegalStateException("No server"); // open listener port open(); if (_threadPool == null) { _threadPool = _server.getThreadPool(); addBean(_threadPool,false); } super.doStart(); // Start selector thread synchronized (this) { _acceptorThreads = new Thread[getAcceptors()]; for (int i = 0; i < _acceptorThreads.length; i++) if (!_threadPool.dispatch(new Acceptor(i))) throw new IllegalStateException("!accepting"); if (_threadPool.isLowOnThreads()) LOG.warn("insufficient threads configured for {}",this); } LOG.info("Started {}",this); }
@Override protected void doStart() throws Exception { if (_server == null) throw new IllegalStateException("No server"); // open listener port open(); if (_threadPool == null) { _threadPool = _server.getThreadPool(); addBean(_threadPool,false); } super.doStart(); // Start selector thread synchronized (this) { _acceptorThreads = new Thread[getAcceptors()]; for (int i = 0; i < _acceptorThreads.length; i++) if (!_threadPool.dispatch(new Acceptor(i))) throw new IllegalStateException("!accepting"); if (_threadPool.isLowOnThreads()) LOG.warn("insufficient threads configured for {}",this); } LOG.info("Started {}",this); }
@Override protected void doStart() throws Exception { if (_server == null) throw new IllegalStateException("No server"); // open listener port open(); if (_threadPool == null) { _threadPool = _server.getThreadPool(); addBean(_threadPool,false); } super.doStart(); // Start selector thread synchronized (this) { _acceptorThreads = new Thread[getAcceptors()]; for (int i = 0; i < _acceptorThreads.length; i++) if (!_threadPool.dispatch(new Acceptor(i))) throw new IllegalStateException("!accepting"); if (_threadPool.isLowOnThreads()) LOG.warn("insufficient threads configured for {}",this); } LOG.info("Started {}",this); }
@Override protected void doStart() throws Exception { if (_server == null) throw new IllegalStateException("No server"); // open listener port open(); if (_threadPool == null) { _threadPool = _server.getThreadPool(); addBean(_threadPool,false); } super.doStart(); // Start selector thread synchronized (this) { _acceptorThreads = new Thread[getAcceptors()]; for (int i = 0; i < _acceptorThreads.length; i++) if (!_threadPool.dispatch(new Acceptor(i))) throw new IllegalStateException("!accepting"); if (_threadPool.isLowOnThreads()) LOG.warn("insufficient threads configured for {}",this); } LOG.info("Started {}",this); }
@Override protected void doStart() throws Exception { if (_server == null) throw new IllegalStateException("No server"); // open listener port open(); if (_threadPool == null) { _threadPool = _server.getThreadPool(); addBean(_threadPool,false); } super.doStart(); // Start selector thread synchronized (this) { _acceptorThreads = new Thread[getAcceptors()]; for (int i = 0; i < _acceptorThreads.length; i++) if (!_threadPool.dispatch(new Acceptor(i))) throw new IllegalStateException("!accepting"); if (_threadPool.isLowOnThreads()) LOG.warn("insufficient threads configured for {}",this); } LOG.info("Started {}",this); }