Hi,

I have found out that I can actually improve performance by using python's
multiprocessing library instead of multithreading, which gets around
python's GLI problem.

I also discovered a very weird problem, which is that if I try to add flows
using multiprocessing.Process(target = add_flow_worker ...), and if I make
the process add less than 20 individual flows, none of the flows will be
added. But if I add more than 20 flows, some will appear on the switch,
which I can check by doing ovs-ofctl dump-flows <br>. When I say some, I
mean like, say I add 20 flows by adding flows with priorities ranging from
1 to 20, and then when I do ovs-ofctl dump-flows br1, it will only show
flows with priorities 1 to 16. 4 of the other flows with priority 17, 18,
19, 20 are not there. And this happens consistently.

The context is that I'm trying to test the latency of adding flows, which I
am doing by sending flows of different priority values. I found that using
multithreading isn't any faster than adding flows serially, but using
multiprocessing the latency does decrease by a lot. However, as I stated
above, I found that some flows are not being added when I use
multiprocessing.

Can you let me know how to fix this?

Thank you,
Yiwen Shen

On Mon, Apr 10, 2017 at 8:31 PM, Yi Tseng <a86487...@gmail.com> wrote:

> Hi,
>
> As I know, it is hard to improve performance by using multi-thread way
> because there is a GIL problem in python.
>
> Moreover, it might be slower if you try to using multi-thread to do simple
> tasks.
>
>
> -Yi
>
> 2017-04-10 9:34 GMT-07:00 Yiwen Shen <ys2...@columbia.edu>:
>
>> Hi,
>>
>> I was wondering if there is any difference in the speed in which I push
>> flows onto a switch serially or if I use multithreading in my app to push
>> flows. Would it still end up being serial at the end or would
>> multithreading reduce the latency?
>>
>> Thanks,
>> Yiwen Shen
>>
>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Ryu-devel mailing list
>> Ryu-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>>
>>
>
>
> --
> Yi Tseng (a.k.a Takeshi)
> Taiwan National Chiao Tung University
> Department of Computer Science
> W2CNLab
>
> https://takeshi.tw
>



-- 
*Yiwen Shen*
PhD Candidate at Lightwave Research Laboratory
<http://lightwave.ee.columbia.edu/>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to