matploblib multithreading

Hi ,When I use matplotlib to draw 2D graphics in django web site,I encounter a problem.

when server users use matplotlib to draw graphics simultaneously will cause website collapse.

when one user use matplotlib to draw graphics will have no problem.

i suppose matplotlib doesnot support multithreading drawing.

so i put the draw function in a thread . it can’t work as before.

so why matplotlib doesnot support multithreading drawing?

How to solve this problem.

Hope I can receive help from you.

Regards

wekay

Have you looked into Celery? It is a queuing system with Django ORM
support. I don't have any experience with it myself, but I have heard
good things about it.

-Aman

2011/2/14 wukan <wekay102200@...287...>:

···

Hi ,When I use matplotlib to draw 2D graphics in django web site,I encounter
a problem.
when server users use matplotlib to draw graphics simultaneously will
cause website collapse.
when one user use matplotlib to draw graphics will have no problem.

i suppose matplotlib doesnot support multithreading drawing.
so i put the draw function in a thread . it can't work as before.

so why matplotlib doesnot support multithreading drawing?
How to solve this problem.
Hope I can receive help from you.

Regards

wekay
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

wukan, on 2011-02-14 23:39, wrote:

Hi ,When I use matplotlib to draw 2D graphics in django web site,I encounter
a problem.
when server users use matplotlib to draw graphics simultaneously will
cause website collapse.
when one user use matplotlib to draw graphics will have no problem.

Is there an error / stack trace generated? Can you give an
example of how you are using matplotlib from django?

I can imagine there being some issue if you are using the pyplot
interface to deal with all user requests (e.g. plt.plot, instead
of allocating an axes object for each user and calling ax.plot).

There's no way for us to know unless you provide more details.

i suppose matplotlib doesnot support multithreading drawing.
so i put the draw function in a thread . it can't work as before.

I don't follow.

so why matplotlib doesnot support multithreading drawing?
How to solve this problem.

Depending on the load, the nature of desired plots, and the need
for user intervention, you might be able to get around the issues
you're having just by spawning a new process to do the plotting.

P.S.
I try to answer all of the questions I feel capable of answering
on the mailing list, there is no need to send duplicates of
mailing list questions directly to me.

best,

···

--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7