Hello Nana, The number of processes and threads have no bearing on this because it is a single request being handled by a single thread.
This likely has nothing to do with mod_wsgi or flask. My guess is that it is somewhere in the database or code processing layer. You are doing 263,000 rows in 170 seconds which is 1,547 rows per second. Not bad by some measurements. Here are a couple of thoughts: 1. Are you running it in a single transaction? 2. Are you using a prepared statement that stays prepared and is not re-prepared each time 3. How long does it take to (upload, parse, insert). You should modify your code to skip 2,3 and then skip 3 and get an idea what time is actually taking. 4. Do you have an extended insert syntax you can use? I have no doubt there are lots of ways to increase performance, but I am also sure that mod_wsgi is not the issue. I suggest you write a test.py script that does this on the command line so you can play with different timings in a repeatable environment. Thanks! On Mon, Mar 14, 2016 at 2:33 PM, Nana Okyere <[email protected]> wrote: > Grham, > > Can you help me make my app(s) run faster on apache with mod_wsgi (latest > version) > > Application Description: > The flask application takes an excel worksheet and writes the rows to and > Oracle table. My stack includes flask, sqlalchemy, openpyxl, cx-oracle. For > excel worksheet with 263,000 rows, it took about 2 minutes 50 seconds for > the excel sheet to be uploaded and the data to be written to oracle when I > assigned 4 processes and 4 threads in my wsgidaemonprocess as: > > WSGIDaemonProcess fbbidataupload.cat.com \ > user=http group=http processes=4 threads=4 \ > > python-home=/WebHA/catworld/featureanalytics-443S/all_virtual_envs/data_upload_tool > \ > python-path=/WebHA/catworld/featureanalytics-443S/dataupload_app > > > I changed the processes to 8 and threads to 8 and tested but the results > are the same. I was hoping that increasing the number of processes and > threads would help with performance but that was not the case. > > The server is redhat 6.7 with apache 2.2.15 , 32 gb of ram, 8 cpus; each > cpu has 1 cpu core. Is there anything I can do to increase the performance > of my application? If you need any more information about the application, > server, virtualhost, please let me know. Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/modwsgi. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/modwsgi. For more options, visit https://groups.google.com/d/optout.
