Hi all,
I have a question here.
Here is my db init code snippet:
engine = create_engine(db_url,
pool_size=100,max_overflow=150,echo=engine_echo,pool_recycle=3600)
session = scoped_session(sessionmaker(bind=engine))
metadata = MetaData(bind=engine)
Then, I use engine to do update/insert
does not initiate any concurrent operations on its own.
Sent from my iPhone
On Apr 8, 2014, at 5:03 AM, Ni Wesley nis...@gmail.com javascript:
wrote:
Hi all,
I have a question here.
Here is my db init code snippet:
engine = create_engine(db_url,
pool_size=100,max_overflow=150,echo
and
dbupdate which are called by other modules.
Based on the above code, mostly I only see 4-5 processlist from mysql
server side...
That's means, I haven't reached the bottleneck of mysql server itself...
在 2014年4月8日星期二UTC+8下午9时52分58秒,Michael Bayer写道:
On Apr 8, 2014, at 8:55 AM, Ni Wesley nis
100 tasks into it.
[wni] I will try creating new engine for each sub process later :-)
On Apr 8, 2014, at 10:21 AM, Ni Wesley nis...@gmail.com javascript:
wrote:
The above procedure can be performed in a shorthand way by using the
execute()http://docs.sqlalchemy.org/en/rel_0_9/core
Hi all,
Today I get an error as title.
I use sqlalchemy + mysql.
Here is my code snippet:
def dbquery(_table,whereclause):
try:
#_table=Table(tablename, metadata, autoload=True)
#_table = tables[tablename]
i=_table.select().where(whereclause)
if
like
mysql-connector-python just to see what’s different.
On Mar 27, 2014, at 7:41 AM, Ni Wesley nis...@gmail.com javascript:
wrote:
Hi all,
Today I get an error as title.
I use sqlalchemy + mysql.
Here is my code snippet:
def dbquery(_table,whereclause):
try
like
mysql-connector-python just to see what’s different.
On Mar 27, 2014, at 7:41 AM, Ni Wesley nis...@gmail.com javascript:
wrote:
Hi all,
Today I get an error as title.
I use sqlalchemy + mysql.
Here is my code snippet:
def dbquery(_table,whereclause):
try
into a bad
state. There are likely patterns in how you’re calling it that lead it to
have this issue but you might try a different DBAPI like
mysql-connector-python just to see what’s different.
On Mar 27, 2014, at 7:41 AM, Ni Wesley nis...@gmail.com wrote:
Hi all,
Today I get an error
Hi all,
I hit a problem when using sqlalchemy operates mysql.
Engine.execute hangs about 5 mins... and then, get error:
'MySQL server has gone away' or 'Lost connection to MySQL server during
query'.
Actually, when operation hangs, I login mysql server is OK.
Why this happened?
Or how to
I tried all you said. Here is my code:
engine = create_engine(db_url,
pool_size=100,max_overflow=150,echo=engine_echo,pool_recycle=3600)
And, in the beginning, I googled a lot and add this:
def _ping_db():
#session.execute('show variables')
try:
session.execute('select 1')
operation and throw into a process pool which only
handle db operation.
在 2014年3月16日星期日UTC+8上午4时14分50秒,Michael Bayer写道:
On Mar 14, 2014, at 9:18 PM, Ni Wesley nis...@gmail.com javascript:
wrote:
Seems sqlalchemy engine pool uses thread, eh?
SQLAlchemy doesn’t spawn any threads, it only
Yes, actually, that's the pattern I used from the beginning, i.e. for every
request(actually tcp server connection request), create a session, do db
operation, commit, and close.
But it's too slow, for 1000 connections requests, it takes more than 40
seconds, so , just yesterday, when using
sqls.
在 2014年3月13日星期四UTC+8下午8时59分34秒,Michael Bayer写道:
On Mar 13, 2014, at 12:10 AM, Ni Wesley nis...@gmail.com javascript:
wrote:
We can see that, from the start point to end point, it takes 50 ms,
including 40ms for engine commit.
For 1000 entries, it takes 40 seconds, here I
1. Yeah, I do have index on app_key and device_token
2. I realized the issue with how I use sessions every request, so , later,
instead of sessions, I directly call engine.execute where engine is
initiated just once from another file.
Seems no improvement compared to session...
在
procedures and call the procedures ,
instead of core sqls.
在 2014年3月13日星期四UTC+8下午8时59分34秒,Michael Bayer写道:
On Mar 13, 2014, at 12:10 AM, Ni Wesley nis...@gmail.com wrote:
We can see that, from the start point to end point, it takes 50 ms,
including 40ms for engine commit.
For 1000
procedures and call the procedures ,
instead of core sqls.
在 2014年3月13日星期四UTC+8下午8时59分34秒,Michael Bayer写道:
On Mar 13, 2014, at 12:10 AM, Ni Wesley nis...@gmail.com wrote:
We can see that, from the start point to end point, it takes 50 ms,
including 40ms for engine commit.
For 1000
Actually I have a question here, I see the main time consuming is commit..
But how to control the time to commit.
Because I don't know when request will come and how many requests will
come, so seems my current code is to commit every engine.execute
在 2014年3月14日星期五UTC+8上午2时14分43秒,Jonathan
Hi all,
I hit a problem that cannot use the connection pool effectively.
engine = create_engine(db_url,pool_size=50,max_overflow=60,
echo=engine_echo,pool_recycle=3600)
from sqlalchemy.sql.expression import text, bindparam
from sqlalchemy.sql import select,insert, delete, update
from
No, I don't use gevent anymore, everything goes from engine, you can see I
have a direct_engine=True to control
在 2014年3月14日星期五UTC+8下午12时22分09秒,Michael Bayer写道:
On Mar 13, 2014, at 11:51 PM, Ni Wesley nis...@gmail.com javascript:
wrote:
Hi all,
I hit a problem that cannot use
Hi guys,
I hit a problem when using sqlalchemy operating mysql.
First, let me clarify my code frames.
I have a web service to receive http requests, then, it send task to a tcp
server via zeromq pull/push mode, tcp server pull and do some push work to
cell phone.
I hit a problem that, tcp
.
Thanks.
Wesley
在 2014年3月12日星期三UTC+8下午9时35分08秒,Michael Bayer写道:
On Mar 12, 2014, at 8:32 AM, Ni Wesley nis...@gmail.com javascript:
wrote:
Hi guys,
I hit a problem when using sqlalchemy operating mysql.
First, let me clarify my code frames.
I have a web service
Just have a try.
Move all operations upon session directly to engine.execute.
Almost the same performance.
How to improve? :-(
在 2014年3月12日星期三UTC+8下午9时35分08秒,Michael Bayer写道:
On Mar 12, 2014, at 8:32 AM, Ni Wesley nis...@gmail.com javascript:
wrote:
Hi guys,
I hit a problem
...@gmail.com, could I
invite you to my friend list?
在 2014年3月13日星期四UTC+8上午10时18分01秒,Michael Bayer写道:
hows your SQL debug output and your profiling going?
On Mar 12, 2014, at 9:56 PM, Ni Wesley nis...@gmail.com javascript:
wrote:
Just have a try.
Move all operations upon session
,
via command watch -n 1 netstat -anpto|grep dbserver_ip|wc -l, I find the
spike value is just 26, actually, I gave 0 to engine pool_size, why it
takes only 26?
Is this related
在 2014年3月12日星期三UTC+8下午8时32分53秒,Ni Wesley写道:
Hi guys,
I hit a problem when using sqlalchemy operating mysql
Hi all,
I hit a problem these day that sqlalchemy session execute hangs some time.
And if one db operation hangs, all the following operations are blocked...
Here is exception snippet:
ERROR:tornado.application:Uncaught exception, closing connection.
Traceback (most recent call last):
File
Here is my code:
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker,scoped_session
from sqlalchemy.schema import MetaData
engine = create_engine(db_url, echo=engine_echo,pool_recycle=300)
session = scoped_session(sessionmaker(bind=engine))
So, for code blocks that need
I mean sqlalchemy ORM, that is, use python class mapping to database table.
I know sqlalchemy core expression does work, this guy doesn't care how
database is created.
Wesley
2014年1月22日 下午7:04于 Simon King si...@simonking.org.uk写道:
On Wed, Jan 22, 2014 at 3:41 AM, Ni Wesley nisp...@gmail.com
Hi guys,
I have a question here.
Just as the title, I mean, for example:
I am using mysql as the database engine.
Now, I use sqlalchemy ORM to map python class to database table.
My question is here:
Actually, there are specified teams to do the database design and tables
creation work.
Hi guys,
I have a question here.
Just as the title, I mean, for example:
I am using mysql as the database engine.
Now, I use sqlalchemy ORM to map python class to database table.
My question is here:
Actually, there are specified teams to do the database design and tables
creation work.
I just find a solution that try to ping database server by select 1 every
give time.
Thanks all you guys.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
Hi all,
I hit a problem when use sqlalchemy with mysql.
I found the problem is mysql's auto close to nonactive connection over 8
hours.
And , I googled a lot and find pool_recycle option for create_engine.
But seems does not work.
Here is my code:
engine = create_engine(db_url,
31 matches
Mail list logo