Insufficient Threads

The required number of server threads may not be available for your query.

Possible Cause

If the client receives a message like Not enough server threads available for this query [-1010011] ['QXA11'], the query requires more kernel threads for the IQ store.

Actions

  • Wait for another query to finish and release the threads it is using. Then resubmit your query.

  • Run the system stored procedure sp_iqconnection. The column IQThreads contains the number of IQ threads currently assigned to the connection. This column can help you determine which connections are using the most resources. Remember that some threads may be assigned but idle.

  • If the condition persists, you may need to restart the server and specify more IQ threads. Use the -iqmt server startup switch to increase the number of processing threads that Sybase IQ can use.

    The default is 60 threads per CPU for the first 4 CPUs and 50 threads per CPU for the remainder, with 3 more for system use, plus threads needed for database connections and background tasks. For example, on a system with 12 CPUs and 10 connections: 60*4 + 50*(numCPUs - 4) + numConnections + 6 = 656. The minimum value is numConnections + 3. The total number of server threads cannot exceed 4096 on 64-bit platforms, or 2048 on 32-bit platforms.

  • If the server runs out of threads, or if sufficient threads are not available to a connection during a restore, Sybase IQ may return the error Ran out of threads. Start up server with more threads. (SQLCODE -1012024). The RESTORE command attempts to allocate a “team” of threads for the restore operation. Sybase IQ attempts to allocate at least one thread per backup device plus two threads per CPU, plus one thread to the “team” for the restore. Make sure that enough threads have been allocated on a per connection and per team basis as well as to the server. Use the MAX_IQ_THREADS_PER_CONNECTION and MAX_IQ_THREADS_PER_TEAM database options.