Issue Details (XML | Word | Printable)

Key: CORE-3194
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Philippe Makowski
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Number of connections to linux superclassic has limit equal 508

Created: 22/Oct/10 08:46 AM   Updated: 04/Feb/11 01:13 PM
Component/s: Engine
Affects Version/s: 2.5.0
Fix Version/s: 2.5.1, 3.0 Alpha 1

Time Tracking:
Not Specified

Environment: SuperClassic Linux

Planning Status: Unspecified


 Description  « Hide
Per each connection superclassic needs 2 handles - one for a socket, next for a database file.

SC stops to open files exactly after reaching 1024 limit. This limit is a glibc standard limit.

This lead to the fact that you can't have more that 508 simultaneous connctions to the same database using SuperClassic under Linux.
Windows is not affected, neither Classic or SuperServer, they can each 1000 simultaneous connections if there are enough ressources on the box.

Possible solution :
- patch glibc raising #define __FD_SETSIZE 1024 to build Firebird (not the best solution)
- use pool() instead of select()
- not re-opening database file each time database is opened, but using instead existing descriptor

here a little Python script to raise the problem :

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import kinterbasdb
kinterbasdb.init(type_conv=300)
from kinterbasdb import services
svcCon = services.connect(host='localhost',user='sysdba', password='masterkey')

l = []
for i in range(1000):
    con = kinterbasdb.connect(dsn='localhost:employee', user='sysdba',
password='masterkey')
    l.append(con)
    cur = con.cursor()
    cur.execute("select FIRST 1 * from COUNTRY")
    print i
    print cur.fetchall()
    print 'Nb connexions :', svcCon.getConnectionCount()
    con.commit()


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 28/Jan/11 04:53 PM
In 2.5 I do not change anything except replacing select() with poll().

Alexander Peshkov added a comment - 28/Jan/11 05:58 PM
Issues with opening database file one or many times should be left till solution with shared cache.