You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by HIRAUCHI Hideyuki <hi...@kiwi.ne.jp> on 2002/03/19 15:23:51 UTC

Performance problem

Hello everyone.]

My name is Hideyuki.
I'm Japanese (& poor at English).

I've got a trouble when I'm trying to optimize performance.
I want to:
    1. set accept queue size 30.
    2. process request on 3 thread concurrently.
So, I wrote below

---conf/server.xml start---
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
               port="8080" minProcessors="3" maxProcessors="3"
               enableLookups="true"
               acceptCount="30" debug="0" connectionTimeout="60000"/>
---conf/server.xml end---

I think it's OK...
But when I send 30 request at once by LoadRunner, 27 requests is failure.
3 request is OK.
Is this a BUG? or a spec?

The source code is below.
I think we need own accept queue. Or Processor thread should do accept form serverSocket directly.

How do you think?


---HttpConnector start (1028)---
            // Hand this socket off to an appropriate processor
            HttpProcessor processor = createProcessor();
            if (processor == null) {
                try {
                    log(sm.getString("httpConnector.noProcessor"));
                    socket.close();
                } catch (IOException e) {
                    ;
                }
                continue;
            }
---HttpConnector end (1038)---

---HttpConnector start (834)---
    /**
     * Create (or allocate) and return an available processor for use in
     * processing a specific HTTP request, if possible.  If the maximum
     * allowed processors have already been created and are in use, return
     * <code>null</code> instead.
     */
    private HttpProcessor createProcessor() {

        synchronized (processors) {
            if (processors.size() > 0) {
                // if (debug >= 2)
                // log("createProcessor: Reusing existing processor");
                return ((HttpProcessor) processors.pop());
            }
            if ((maxProcessors > 0) && (curProcessors < maxProcessors)) {
                // if (debug >= 2)
                // log("createProcessor: Creating new processor");
                return (newProcessor());
            } else {
                if (maxProcessors < 0) {
                    // if (debug >= 2)
                    // log("createProcessor: Creating new processor");
                    return (newProcessor());
                } else {
                    // if (debug >= 2)
                    // log("createProcessor: Cannot create new processor");
                    return (null);
                }
            }
        }

    }
---HttpConnector end (865)---

-- 
HIRAUCHI Hideyuki <hi...@kiwi.ne.jp>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>