python - IRC Bot, performance and scaling -


i have made simple irc bot myself in python works great, friends has asked me if bot can join irc channel too. irc channels active, twitch chat(irc wrapper), means lot of messages. want them use bot, have no idea how perform, first bot i've made.

right code this:
connect irc server & channel while true: receive data socket (4096, max data received @ once) data received

what changes should make perform better?
1. should have sleep function in loop?
2. should use threads?
3. general dos , don'ts?

thank reading post.

threading 1 option doesn't scale beyond point (google python gic limitation). depending on how scaling want do, need multi-process (launch multiple instances).

one pattern have pool of worker threads process queue of things do. there's lot of overhead creating , destroying threads in languages.


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -