Insufficient Threads

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

Possible Cause

A client message similar to Not enough server threads available for this query [-1010011] ['QXA11'] indicates that the query requires additional 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 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. Some threads may be assigned but idle.

  • If the condition persists, you may need to restart the server and specify additional IQ threads. Use the -iqmt server startup switch to increase the number of processing threads that SAP 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, you may see 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. SAP Sybase IQ attempts to allocate at least one thread per backup device, plus two threads per CPU, plus one thread to the team. Make sure you have allocated enough threads on both 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.