CN105187270A - Method for realizing network card performance optimization of LINUX system - Google Patents
Method for realizing network card performance optimization of LINUX system Download PDFInfo
- Publication number
- CN105187270A CN105187270A CN201510503654.0A CN201510503654A CN105187270A CN 105187270 A CN105187270 A CN 105187270A CN 201510503654 A CN201510503654 A CN 201510503654A CN 105187270 A CN105187270 A CN 105187270A
- Authority
- CN
- China
- Prior art keywords
- mask
- echo
- irq
- vec
- dev
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 17
- 238000005457 optimization Methods 0.000 title abstract description 6
- 238000012795 verification Methods 0.000 claims description 2
- 238000012360 testing method Methods 0.000 abstract description 10
- 238000011017 operating method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000010429 evolutionary process Effects 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method for realizing network card performance optimization of an LINUX system, which relates to a network card compatibility test technology, and comprises the following operation steps of 1) DOS2UNIX script files; 2) and operating the corresponding program. The method can automatically read the information of the test network card, and simultaneously automatically realize interrupt binding and balance the pressure of the CPU. The network card performance optimization method can help us quickly and accurately perform network card performance optimization.
Description
Technical field
The present invention relates to network interface card compatibility test technology, particularly relate to a kind of method realizing LINUX system network interface card Performance tuning.
Background technology
Along with the development of current measuring technology, various testing tool, testing software and method are more and more applied to the test of server product and various parts.
Usually snap past in journey in Test Network, the situation that the test performance of some network interface cards and theoretical performance differ greatly is met in capital, the reason that this thing happens is had nothing in common with each other, generally speaking, bind relevant to the interruption of CPU and network interface card, therefore done some tentative tunings, to reaching the object of performance optimization for the network interface card introduced in the recent period.
Summary of the invention
The network interface card introduced, when doing compatibility test, finds that bandwidth cannot reach the test of theoretical bandwidth 90% by standard, through attempting optimizing, reaching and passing through standard.Therefore, the present invention proposes a kind of method realizing LINUX system network interface card Performance tuning, arrange the operating procedure that evolutionary process is made, to realize resource-sharing for this network interface card.
Operating procedure of the present invention
1) DOS2UNIX script file;
2), corresponding program is run.
This method is under LINUX system, by related command, realizes respectively interrupting binding and verification operation result realizes.
Its specific implementation content is as follows:
set_affinity()
{
if[$VEC-ge32]
then
MASK_FILL=""
MASK_ZERO="00000000"
let"IDX=$VEC/32"
for((i=1;i<=$IDX;i++))
do
MASK_FILL="${MASK_FILL},${MASK_ZERO}"
done
let"VEC-=32*$IDX"
MASK_TMP=$((1<<$VEC))
MASK=`printf"%X%s"$MASK_TMP$MASK_FILL`
else
MASK_TMP=$((1<<$VEC))
MASK=`printf"%X"$MASK_TMP`
fi
printf"%smask=%sfor/proc/irq/%d/smp_affinity?n"$DEV$MASK$IRQ
printf"%s"$MASK>/proc/irq/$IRQ/smp_affinity
}
if["$1"=""];then
echo"Description:"
echo"Thisscriptattemptstobindeachqueueofamulti-queueNIC"
echo"tothesamenumberedcore,ietx0|rx0-->cpu0,tx1|rx1-->cpu1"
echo"usage:"
echo"$0eth0[eth1eth2eth3]"
fi
#checkforirqbalancerunning
IRQBALANCE_ON=`psax|grep-vgrep|grep-qirqbalance;echo$?`
if["$IRQBALANCE_ON"=="0"];then
echo"WARNING:irqbalanceisrunningandwill"
echo"likelyoverridethisscript'saffinitization."
echo"Pleasestoptheirqbalanceserviceand/orexecute"
echo"'killallirqbalance'"
fi
#
#Setupthedesireddevices.
#
forDEVin$*
do
forDIRinrxtxTxRx
do
MAX=`grep$DEV-$DIR/proc/interrupts|wc-l`
if["$MAX"=="0"];then
MAX=`egrep-i"$DEV:.*$DIR"/proc/interrupts|wc-l`
fi
if["$MAX"=="0"];then
echono$DIRvectorsfoundon$DEV
continue
fi
forVECin`seq01$MAX`
do
IRQ=`cat/proc/interrupts|grep-i$DEV-$DIR-$VEC"$"|cut-d:-f1|sed"s///g"`
if[-n"$IRQ"];then
set_affinity
else
IRQ=`cat/proc/interrupts|egrep-i$DEV:v$VEC-$DIR"$"|cut-d:-f1|sed"s///g"`
if[-n"$IRQ"];then
set_affinity
fi
fi
done
done
done。
The invention has the beneficial effects as follows.
The method is a kind of efficient and convenient, easy to operate and can avoid the method for a kind of network interface card tuning of manually makeing mistakes.It can realize the information of automatic read test network interface card, automatically realizes interrupting binding, balanced CPU pressure simultaneously.Us can be helped to carry out network interface card Performance tuning fast and accurately.
Embodiment
More detailed elaboration is carried out to content of the present invention below:
set_affinity()
{
if[$VEC-ge32]
then
MASK_FILL=""
MASK_ZERO="00000000"
let"IDX=$VEC/32"
for((i=1;i<=$IDX;i++))
do
MASK_FILL="${MASK_FILL},${MASK_ZERO}"
done
let"VEC-=32*$IDX"
MASK_TMP=$((1<<$VEC))
MASK=`printf"%X%s"$MASK_TMP$MASK_FILL`
else
MASK_TMP=$((1<<$VEC))
MASK=`printf"%X"$MASK_TMP`
fi
printf"%smask=%sfor/proc/irq/%d/smp_affinity?n"$DEV$MASK$IRQ
printf"%s"$MASK>/proc/irq/$IRQ/smp_affinity
}
if["$1"=""];then
echo"Description:"
echo"Thisscriptattemptstobindeachqueueofamulti-queueNIC"
echo"tothesamenumberedcore,ietx0|rx0-->cpu0,tx1|rx1-->cpu1"
echo"usage:"
echo"$0eth0[eth1eth2eth3]"
fi
#checkforirqbalancerunning
IRQBALANCE_ON=`psax|grep-vgrep|grep-qirqbalance;echo$?`
if["$IRQBALANCE_ON"=="0"];then
echo"WARNING:irqbalanceisrunningandwill"
echo"likelyoverridethisscript'saffinitization."
echo"Pleasestoptheirqbalanceserviceand/orexecute"
echo"'killallirqbalance'"
fi
#
#Setupthedesireddevices.
#
forDEVin$*
do
forDIRinrxtxTxRx
do
MAX=`grep$DEV-$DIR/proc/interrupts|wc-l`
if["$MAX"=="0"];then
MAX=`egrep-i"$DEV:.*$DIR"/proc/interrupts|wc-l`
fi
if["$MAX"=="0"];then
echono$DIRvectorsfoundon$DEV
continue
fi
forVECin`seq01$MAX`
do
IRQ=`cat/proc/interrupts|grep-i$DEV-$DIR-$VEC"$"|cut-d:-f1|sed"s///g"`
if[-n"$IRQ"];then
set_affinity
else
IRQ=`cat/proc/interrupts|egrep-i$DEV:v$VEC-$DIR"$"|cut-d:-f1|sed"s///g"`
if[-n"$IRQ"];then
set_affinity
fi
fi
done
done
done
This method can realize network interface card performance optimization fast, reaches its theoretical bandwidth as far as possible, can realize layoutprocedure fast, greatly raise the efficiency by the method, and the mistake such as mistake, leakage that may occur when no one is configuration.The method is simple to operate, and practicality is comparatively strong, has good effect for some case studies, product parameters Performance tuning etc.
Claims (3)
1. can realize a method for LINUX system network interface card Performance tuning, it is characterized in that,
1), DOS2UNIX script file;
2), corresponding program is run.
2. method according to claim 1, is characterized in that,
Its specific implementation content is as follows:
set_affinity()
{
if[$VEC-ge32]
then
MASK_FILL=""
MASK_ZERO="00000000"
let"IDX=$VEC/32"
for((i=1;i<=$IDX;i++))
do
MASK_FILL="${MASK_FILL},${MASK_ZERO}"
done
let"VEC-=32*$IDX"
MASK_TMP=$((1<<$VEC))
MASK=`printf"%X%s"$MASK_TMP$MASK_FILL`
else
MASK_TMP=$((1<<$VEC))
MASK=`printf"%X"$MASK_TMP`
fi
printf"%smask=%sfor/proc/irq/%d/smp_affinity?n"$DEV$MASK$IRQ
printf"%s"$MASK>/proc/irq/$IRQ/smp_affinity
}
if["$1"=""];then
echo"Description:"
echo"Thisscriptattemptstobindeachqueueofamulti-queueNIC"
echo"tothesamenumberedcore,ietx0|rx0-->cpu0,tx1|rx1-->cpu1"
echo"usage:"
echo"$0eth0[eth1eth2eth3]"
fi
#checkforirqbalancerunning
IRQBALANCE_ON=`psax|grep-vgrep|grep-qirqbalance;echo$?`
if["$IRQBALANCE_ON"=="0"];then
echo"WARNING:irqbalanceisrunningandwill"
echo"likelyoverridethisscript'saffinitization."
echo"Pleasestoptheirqbalanceserviceand/orexecute"
echo"'killallirqbalance'"
fi
#
#Setupthedesireddevices.
#
forDEVin$*
do
forDIRinrxtxTxRx
do
MAX=`grep$DEV-$DIR/proc/interrupts|wc-l`
if["$MAX"=="0"];then
MAX=`egrep-i"$DEV:.*$DIR"/proc/interrupts|wc-l`
fi
if["$MAX"=="0"];then
echono$DIRvectorsfoundon$DEV
continue
fi
forVECin`seq01$MAX`
do
IRQ=`cat/proc/interrupts|grep-i$DEV-$DIR-$VEC"$"|cut-d:-f1|sed"s///g"`
if[-n"$IRQ"];then
set_affinity
else
IRQ=`cat/proc/interrupts|egrep-i$DEV:v$VEC-$DIR"$"|cut-d:-f1|sed"s///g"`
if[-n"$IRQ"];then
set_affinity
fi
fi
done
done
done。
3. method according to claim 1, is characterized in that, under LINUX system, by order, realizes each interruption binding and verification operation result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510503654.0A CN105187270A (en) | 2015-08-17 | 2015-08-17 | Method for realizing network card performance optimization of LINUX system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510503654.0A CN105187270A (en) | 2015-08-17 | 2015-08-17 | Method for realizing network card performance optimization of LINUX system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105187270A true CN105187270A (en) | 2015-12-23 |
Family
ID=54909123
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510503654.0A Pending CN105187270A (en) | 2015-08-17 | 2015-08-17 | Method for realizing network card performance optimization of LINUX system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105187270A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105068911A (en) * | 2015-08-20 | 2015-11-18 | 浪潮电子信息产业股份有限公司 | Method for optimizing network card performance aiming at CPU kernel |
CN106101019A (en) * | 2016-06-22 | 2016-11-09 | 浪潮电子信息产业股份有限公司 | Interrupt binding-based multi-queue network card performance tuning method |
CN107943632A (en) * | 2017-11-23 | 2018-04-20 | 郑州云海信息技术有限公司 | A kind of method and system for realizing each disk balancing performance in more NVME disks configuration servers |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7653005B2 (en) * | 2005-12-22 | 2010-01-26 | Huawei Technologies Co., Ltd. | Method, device and system for monitoring network performance |
CN103546344A (en) * | 2013-10-22 | 2014-01-29 | 上海斐讯数据通信技术有限公司 | Wireless router performance testing system and method |
CN104268076A (en) * | 2014-09-23 | 2015-01-07 | 浪潮电子信息产业股份有限公司 | Testing method suitable for automatically testing memory bandwidth of each processor platform |
-
2015
- 2015-08-17 CN CN201510503654.0A patent/CN105187270A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7653005B2 (en) * | 2005-12-22 | 2010-01-26 | Huawei Technologies Co., Ltd. | Method, device and system for monitoring network performance |
CN103546344A (en) * | 2013-10-22 | 2014-01-29 | 上海斐讯数据通信技术有限公司 | Wireless router performance testing system and method |
CN104268076A (en) * | 2014-09-23 | 2015-01-07 | 浪潮电子信息产业股份有限公司 | Testing method suitable for automatically testing memory bandwidth of each processor platform |
Non-Patent Citations (1)
Title |
---|
51CTO: "网卡软中断优化", 《HTTP://CHENWENMING.BLOG.51CTO.COM/327092/1592507》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105068911A (en) * | 2015-08-20 | 2015-11-18 | 浪潮电子信息产业股份有限公司 | Method for optimizing network card performance aiming at CPU kernel |
CN106101019A (en) * | 2016-06-22 | 2016-11-09 | 浪潮电子信息产业股份有限公司 | Interrupt binding-based multi-queue network card performance tuning method |
CN107943632A (en) * | 2017-11-23 | 2018-04-20 | 郑州云海信息技术有限公司 | A kind of method and system for realizing each disk balancing performance in more NVME disks configuration servers |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8640241B2 (en) | Data identification system | |
US9767004B2 (en) | Dynamic call tracking method based on CPU interrupt instructions to improve disassembly quality of indirect calls | |
US20110154297A1 (en) | Dynamic instrumentation | |
WO2008051972A3 (en) | Systems and methods for transmitting and installing software on a gaming machine in gaming network | |
US9898386B2 (en) | Detecting byte ordering type errors in software code | |
CN102799519A (en) | Automatic test method for cluster file system | |
CN105187270A (en) | Method for realizing network card performance optimization of LINUX system | |
US10114677B2 (en) | Method and system for workload recommendations on information handling systems | |
US20180025162A1 (en) | Application program analysis apparatus and method | |
CN105279036A (en) | Inter-process communication method and device and electronic equipment | |
CN107977256A (en) | It is a kind of to the access method of FPGA accelerator cards, device and medium | |
CN107133233B (en) | Processing method and device for configuration data query | |
CN104731617A (en) | Server starting device determining method | |
CN109542398B (en) | Business system generation method and device and computer readable storage medium | |
CN108628712B (en) | Application program testing method and terminal equipment | |
CN108959929B (en) | Program file processing method and device | |
KR102214981B1 (en) | Request processing method and apparatus | |
CN103425580A (en) | Method for automatically and rapidly obtaining and calibrating configuration information of cloud computing device | |
US11366800B2 (en) | System and method to automate validating media redirection in testing process | |
CN105068911A (en) | Method for optimizing network card performance aiming at CPU kernel | |
CN108874596B (en) | Server stability testing method and server | |
CN105786499A (en) | Software packaging method and system | |
CN104753741A (en) | Network card test performance adjustment method and device | |
CN104572282A (en) | Automatic method for binding SAS controller interruption to CPU | |
CN105279110A (en) | Host system identification method by USB (universal serial port) equipment, and USB equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20151223 |
|
WD01 | Invention patent application deemed withdrawn after publication |