Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

[IDEA] Dynamic priority process
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Idea: Dynamic priority process
12th Aug, 2013, 04:02 PM
Post: #18
mk01 Offline
Registered
Posts: 2,485
Joined: Mar 2013
Reputation: 209
RE: Dynamic priority process
(26th Jul, 2013 11:17 PM)belese Wrote:  ps :
seems there's a bug in ipconnection bridge,
for transmission, it didn't detect end of connection now.

belese, as always too late, but still maybe you use in future.

with standard netfilter it's easy as:
Code:
root@media:/var/log# iptables -L -n -v
Chain INPUT (policy ACCEPT 292 packets, 32127 bytes)
pkts bytes target     prot opt in     out     source               destination        

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination        

Chain OUTPUT (policy ACCEPT 165 packets, 31081 bytes)
pkts bytes target     prot opt in     out     source               destination

normally those chains are meant for firewalling / routing, but we can downsize it's function to just count packets / bytes.

so if you want to monitor for instance port 22 (ssh), add a rule to ACCEPT
Code:
iptables -I INPUT -j ACCEPT -p tcp --dport 22

with result
Code:
root@media:/var/log# iptables -L -n -v
Chain INPUT (policy ACCEPT 473 packets, 50461 bytes)
pkts bytes target     prot opt in     out     source               destination        
   17  2053 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination        

Chain OUTPUT (policy ACCEPT 289 packets, 49084 bytes)
pkts bytes target     prot opt in     out     source               destination

you can poll this numbers with grep or let it send to a file descriptor (opened by variant of your python script which listens to the xbmc events). from this point of view, it;s the same. you just use LOG policy instead of accept.

and to get rid of calculations in the bridge script, you can directly define priority targets directly in netfilter, what means according to current bandwidth (not only absolute pkt/bytes numbers) to MARK and then LOG.

so at the end you would have in input chain four rules, with target MARK, described not by port number but RATE, followed by one rule to LOG, which would on some transfer send a human readable text line MARKed already according your priority split.

so the bridge daemon would be just a loop with case and initctl emit.

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Messages In This Thread
Dynamic priority process - belese - 13th Jul, 2013, 12:25 AM
RE: Dynamic priority process - Fred - 13th Jul, 2013, 01:00 AM
RE: Dynamic priority process - belese - 13th Jul, 2013, 01:11 AM
RE: Dynamic priority process - mk01 - 18th Jul, 2013, 05:10 AM
Re: Dynamic priority process - f1vefour - 13th Jul, 2013, 07:44 AM
RE: Dynamic priority process - Fred - 13th Jul, 2013, 07:57 AM
RE: Dynamic priority process - belese - 13th Jul, 2013, 07:09 PM
RE: Dynamic priority process - Fred - 13th Jul, 2013, 08:57 PM
RE: Dynamic priority process - mk01 - 17th Jul, 2013, 05:52 AM
RE: Dynamic priority process - belese - 17th Jul, 2013, 07:33 PM
RE: Dynamic priority process - belese - 18th Jul, 2013, 09:32 AM
RE: Dynamic priority process - mk01 - 19th Jul, 2013, 06:42 AM
RE: Dynamic priority process - belese - 18th Jul, 2013, 10:40 PM
RE: Dynamic priority process - belese - 25th Jul, 2013, 05:58 AM
RE: Dynamic priority process - CurlyMo - 25th Jul, 2013, 08:25 AM
RE: Dynamic priority process - belese - 25th Jul, 2013, 06:32 PM
RE: Dynamic priority process - belese - 26th Jul, 2013, 11:17 PM
RE: Dynamic priority process - mk01 - 12th Aug, 2013 04:02 PM
RE: Dynamic priority process - belese - 13th Aug, 2013, 01:35 AM
RE: Dynamic priority process - mk01 - 13th Aug, 2013, 02:36 AM
RE: Dynamic priority process - belese - 14th Aug, 2013, 02:47 AM
RE: Dynamic priority process - mk01 - 14th Aug, 2013, 03:37 AM
RE: Dynamic priority process - belese - 14th Aug, 2013, 05:19 AM

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 25th May, 2025, 12:00 PM Powered By MyBB, © 2002-2025 MyBB Group.