FreeBSD 7的TSO特性
因为我用的网卡多数都是em(4),所以在最近的升级中也就利用了它提供的TSO功能。TSO是一项减少服务器负载的技术,其原理是将TCP相关的一部分计算交给网卡去做。
共105篇文章。
因为我用的网卡多数都是em(4),所以在最近的升级中也就利用了它提供的TSO功能。TSO是一项减少服务器负载的技术,其原理是将TCP相关的一部分计算交给网卡去做。
以前一直觉得mailman与postfix的VERP支持配合的很不好,今天把它patch掉了。需要注意一点即postfix的smtpd默认设置为$authorized,这个值没有意义,需要自己改成合适的值。
pointyhat集群的kris老大前天发来了tmpfs的初步测试结果,很振奋。目前,tmpfs的性能在测试用例的环境下已经达到了md+ufs最佳性能的2-2.5倍,并且,得益于在向FreeBSD移植过程中增加的细粒度上锁,tmpfs在多CPU的环境下表现出了非常好的可伸缩性。
Jeff提交了ULE调度器的3.0版(sched,巧合?:)),这个版本对调度器本身的上锁进行了细化,从而带来了性能改善(最上面那根黄线,之前是下面那根青色的线)。
这周找了些公司淘汰的设备来测试ZFS。用14块SCSI盘的傻盘阵搭了一个RAID-Z2(可以掉两块盘的RAID-Z,1块盘作为热备)。测试机为2GB内存、双CPU(Xeon 5140双核、amd64模式)。
周六、周日两天的AsiaBSDCon正式报告会,内容非常充实,以至于我都没有时间去整理和把一些感想写出来。今天终于准备离开了,现在是当地时间早上1点半。
说说我比较关注的几个报告。
前一阵观察发现tarsier的负载主要来自于对内存的过度使用。遂为其增加了1GB内存,目前做压力测试中。
压力测试工具为make -j4 universe
今天帮同事调一个程序。
问题:服务器,FreeBSD 6.2上,某程序速度是一台配置较低的笔记本上的Ubuntu的大约1/10。
折腾许久,手工改了一堆port,发现没作用。遂祭出ktrace,发现那个程序十分不理性地mmap一个中文ttf文件;将字体改为英文的,则速度一样。另一个诡异的问题是,使用中文字体会疯狂吃内存。
然后改了freetype2,令其不使用mmap,发现不再出现不理性的内存占用了,速度提高10倍。
📜 历史文件已不具备现实意义
本文记录了2007年1月FreeBSD
-CURRENT合入ULE 2.0调度器时的情形,文中对 SCHED_ULE及sched_core的讨论仅反映当时的历史背景。
Today, Jeff Roberson has committed his version 2.0 ULE scheduler. This new version has addressed several design issues as well as several bugs.
The new scheduler has adopted a circular queue, instead of the double-queue structure which is also found in the Linux scheduler. The latter has lead to difficulty implementing nice correctly.
For uniprocessor case, ULE is now faster.
MP algorithm has been simplified a bit.
A lot of bugfixes, etc.
To quote the original commit message:
ULE 2.0:
- Remove the double queue mechanism for timeshare threads. It was slow due to excess cache lines in play, caused suboptimal scheduling behavior with niced and other non-interactive processes, complicated priority lending, etc.
- Use a circular queue with a floating starting index for timeshare threads. Enforces fairness by moving the insertion point closer to threads with worse priorities over time.
- Give interactive timeshare threads real-time user-space priorities and place them on the realtime/ithd queue.
- Select non-interactive timeshare thread priorities based on their cpu utilization over the last 10 seconds combined with the nice value. This gives us more sane priorities and behavior in a loaded system as compared to the old method of using the interactivity score. The interactive score quickly hit a ceiling if threads were non-interactive and penalized new hog threads.
- Use one slice size for all threads. The slice is not currently dynamically set to adjust scheduling behavior of different threads.
- Add some new sysctls for scheduling parameters.
Bug fixes/Clean up:
- Fix zeroing of
td_schedafter initialization inschedcaused by recent ksegrp removal._fork _thread() - Fix KSE interactivity issues related to frequent forking and exiting of kse threads. We simply disable the penalty for thread creation and exit for kse threads.
- Cleanup the cpu estimator by using tickincr here as well. Keep ticks and ltick/ftick in the same frequency. Previously ticks were stathz and others were hz.
- Lots of new and updated comments.
- Many many others.
Tested on: up x86/amd64, 8way amd64.
对于MP内核来说,这是一项用于寻找内核中存在的性能弱点的重要工具。早先kris做的性能评估看来可以继续、常规化地做下去了。