Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of connections to linux superclassic has limit equal 508 [CORE3194] #3568

Closed
firebird-issue-importer opened this issue Oct 22, 2010 · 8 comments

Comments

@firebird-issue-importer

Submitted by: @pmakowski

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()

Commits: d1df535 20b1568 8af6268

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 22, 2010

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 28, 2011

Modified by: @AlexPeshkoff

summary: SuperClassic pthread create failed => Number of connections to linux superclassic has limit equal 508

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 28, 2011

Commented by: @AlexPeshkoff

In 2.5 I do not change anything except replacing select() with poll().

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 28, 2011

Modified by: @AlexPeshkoff

Fix Version: 2.5.1 [ 10333 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 28, 2011

Commented by: @AlexPeshkoff

Issues with opening database file one or many times should be left till solution with shared cache.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 28, 2011

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 4, 2011

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 18, 2016

Modified by: @pavel-zotov

QA Status: No test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants