OperationalError:(2001,“Can not create UNIX socket(24)”) [英] OperationalError: (2001, "Can't create UNIX socket (24)")
问题描述
我使用的是django-1.2和python-2.6,我正在使用mysql服务器。
I am using django-1.2 and python-2.6 and I am using mysql server.
在工作一段时间后 - 选择和更新记录,我收到了这个错误:
After working for a while - selecting and updating records, I got this error:
Exception in thread Thread-269:
Traceback (most recent call last):
File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
File "dispatcher.py", line 42, in run
File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line 80, in __len__
File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line 271, in iterator
File "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 677, in results_iter
File "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 731, in execute_sql
File "/usr/lib/python2.6/site-packages/django/db/backends/__init__.py", line 75, in cursor
File "/usr/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 297, in _cursor
File "/usr/lib64/python2.6/site-packages/MySQLdb/__init__.py", line 81, in Connect
File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 187, in __init__
OperationalError: (2001, "Can't create UNIX socket (24)")
这里是我的 dispatcher.py
中的第41,42行:
here are lines 41,42 of my dispatcher.py
:
dataList = Mydata.objects.filter(date__isnull=True)[:chunkSize]
print '%s - DB worker finished reading %s entrys' % (datetime.now(),len(dataList))
任何线索为什么我得到这个错误?
我尝试谷歌搜索,但找不到答案。
Any clue why I get this error?
I tried googling but could not find an answer.
我使用django连接到数据库 - (我使用localhost)
I am connecting to the db using django - (I am using localhost)
推荐答案
在我的机器上,errno == 24被定义为
On my machine, errno==24 is defined like
#define EMFILE 24 /* Too many open files */
这意味着你已经用完了filedescriptors。您的应用程式是一次又一次的打开他们(而不是关闭它们)泄漏的描述文件。
Which means you are running out of filedescriptors. Your app is "leaking" filedescriptors by opening them (and not closing them) again and again.
这篇关于OperationalError:(2001,“Can not create UNIX socket(24)”)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!