Bug 480687 - Udev helper "rename_device" saturates the system with thousands of devices
Summary: Udev helper "rename_device" saturates the system with thousands of devices
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-19 20:24 UTC by Dan Smith
Modified: 2014-03-17 03:17 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-19 21:57:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Improve performance with large numbers of interfaces (3.17 KB, patch)
2009-01-19 20:24 UTC, Dan Smith
no flags Details | Diff

Description Dan Smith 2009-01-19 20:24:38 UTC
Created attachment 329396 [details]
Improve performance with large numbers of interfaces

Description of problem:
The rename_device helper inefficiently scans sysfs for information about a given network device, which becomes very slow if the system has a large number of network devices (as would be the case on a system with many virtualized guests).  The attached patch improves the performance by streamlining the process of getting interface information.

Using a test of creating 1500 veth pairs (3000 devices total), the attached patch improves performance by 250% and significantly decreases the load on the system during the test.

Tested on Fedora x86_64.

 rename_device.c |   92 +++++++++++---------------------------------------------
 1 file changed, 19 insertions(+), 73 deletions(-)

Version-Release number of selected component (if applicable): The patch was generated and tested with initscripts-8.86.


How reproducible: Always.


Steps to Reproduce:
1. Write a script to generate 1500 veth devices
2. Measure time to run the script before and after the patch

Comment 1 Bill Nottingham 2009-01-19 21:54:15 UTC
There's an obvious bug/typo in your new asprintf call, but looks good otherwise. Added.

Comment 2 Bill Nottingham 2009-01-19 21:57:14 UTC
http://git.fedorahosted.org/git/?p=initscripts.git;a=commitdiff;h=eb1d89063ed017db9deed6fe7ed9e0beef77eb6b

Will get to rawhide at some point.


Note You need to log in before you can comment on or make changes to this bug.