marți, 14 iulie 2009

Instanțe apache 2 multiple pe FreeBSD

Mi s-a întâmplat de câteva ori să am nevoie să rulez mai multe instanțe de server apache pe un server. Deși metoda folosirii virtualhost este adesea suficientă, unicitatea anumitor directive din fișierul de configurare httpd.conf face necesară rularea de instanțe multiple.
Una dintre metodele de a rula mai multe servere apache concomitent este folosirea conceptului FreeBSD 'jail', care conferă o multitudine de avantaje, cum ar fi posibilitatea de a instala doar extensiile php strict necesare respectivei instanțe și izolarea mai bună față de server, dar punerea pe picioare a unui jail poate dura destul de mult.

O variantă alternativă este folosirea de profile de instanță apache distincte, care partajează același set de librării și extensii php, însă folosind fișiere de configurare diferite, lucru facilitat chiar de scriptul de pornire a serverului instalat de pachetul apache22. Pentru fiecare profil configurat, urmează a se pune în execuție câte un proces apache, cu setări specifice.
Astfel, în fișierul global de configurare a sistemului, /etc/rc.conf, directivele referitoare la apache22 se extind față de directivele uzuale:
# directive apache22 clasice, comune
apache22_enable="YES"
apache22_http_accept_load="YES"
apache22_http_accept_enable="YES"

# Directive apache22 care permit folosirea de profile
apache22_profiles="default p1"
apache22_default_enable="YES"
apache22_default_http_accept_enable="YES"
apache22_default_configfile="/usr/local/etc/apache22/httpd.conf"
apache22_p1_enable="YES"
apache22_p1_http_accept_enable="YES"
apache22_p1_configfile="/usr/local/etc/apache22/httpd-p1.conf"

Acum voi detalia semnificația directivelor suplimentare
apache22_profiles="p1 p2 p3"
indică scriptului /usr/local/etc/rc.d/apache22 să folosească instanțe multiple, instanțe identificate prin lista separată cu spații. Pentru fiecare profil, fișierul /etc/rc.conf va trebui să includă câte un set de directive de forma "apache22_profil_directiva=valoare".

Directivele specifice fiecărui profil sunt:

apache22_profil_configfile="/cale/catre/fisier/configurare/httpd.profil.conf"
apache22_profil_enable="YES|NO"
apache22_profil_flags="alte_directive_pentru_httpd_specifice_pentru_acest_profil"
apache22_profil_http_accept_enable="YES|NO"
apache22_profil_limits_enable="YES|NO"
apache22_profil_limits_args="limits_args"
apache22_profil_fib="FIB"


Este strict necesară indicarea fișierului de configurare al respectivului profil, toate celelalte directive fiind opționale. O directivă interesantă este "FIB", care nu poate avea efect decât pe FreeBSD mai recent de 7.1, care se referă la 'Forward Information Base' (FIB) asociat cu respectiva instanță apache. Începând de la versiunea 7.1, FreeBSD poate folosi multiple FIB-uri, lucru care permite folosirea de tabele de rutare diferite pentru procese diferite.

În continuare, se crează fișierul de configurare httpd-profil.conf specific respectivului profil, probabil pornind de la o versiune salvată sau de la fișierul de configurare inclus în distribuția Apache22. Va trebui să ajustați câteva setări importante: adresa IP si portul folosit de profil, amplasarea DocumentRoot, si în mod special amplasarea log-urilor, pentru a nu fi scrise în același loc cu logurile altor profile. Atenție mare și la adresa IP/port, dacă sunt mai multe servicii configurate să foloseasca acelasi IP și același port, uul dintre ele nu va putea porni.

Pentru pornirea tuturor instanțelor apache nu mai rămâne de făcut decât:
/usr/local/etc/rc.d/apache22 start

joi, 9 iulie 2009

X-Fi Titanium Fatal1ty Professional - Gaming performance


I've been digging the net for some X-Fi gaming performance benchmarks for a while, but I wasn't able to find anything more than Creative's own benchmark done with UT 2004. So... I began my own research.

What is an X-Fi card

Creative is using the X-Fi brand for their most recent product lineup targeted to the non-professional users. Since X-Fi launch, there were two processors capable of hardware acceleration: CA20K1 (a.k.a. EMU20K1), followed few years later by CA20K2 (a.k.a. EMU20K2). CA20K1 processor seems to be 24 times faster than the previous generation's processor (Audigy). A major difference between Audigy and X-Fi is the effects processor sampling rate and number of bits for audio resolution. Audigy was able to apply sound effects only at 48kHz/16 bit, so if the source signal wasn't 48kHz/16 bit, it needed to be resampled, and the resampling operation generates intremodulation distortion. CA20K1 is used in the first generation of X-Fi sound cards, connected through PCI slots, while CA20K2 is used on PCI Express based variants, Titanium family. Being a revised chipset, CA20K2 also fixes the 'Sound crackling and popping' issues.

But... these processors are not included in all X-Fi products. For example, the cheapest sound card from Creative branded X-Fi is 'X-Fi Extreme Audio', a card which looks like the previous generation cheap card, Audigy SE. It has a PCI Express counterpart, but this cannot accelerate in any way audio processing. This does not mean that X-Fi Extreme Audio is using an older processor for hardware acceleration, it means that Audigy SE does not use hardware acceleration at all. Since I wanted a card with hardware accelerated DSP/processing I've decided that a card from the X-Fi Titanium family should be enough for me, and I wanted to have available the 'Crystalyzer'.

After few days using it on a Logitech Z2300 speaker system, I wasn't sure if the sound quality was superior or below onboard ALC889 when listening music and/or watching movies, and googling over the net showed me that it's the DAC the most important chip, that Auzentec X-Fi prelude is better than X-Fi Titanium, that Asus Xonar D2X has superior DAC, that EAX is dying, and many things which made me ask myself if the X-Fi Titanium Fatal1ty is worth the money. In fact, EAX is not dying, but Creative is implementing EAX on vista through OpenAL extensions.

So i decided to measure gaming performance improvement on Unreal Tournament 3, a game which is using OpenAL, comparing X-Fi Titanium Fatal1ty gaming performance with onboard audio provided by an ALC889 chip. Since I didn't have another sound card for comparision, the results are limited, but I found some convincing results. If anyone do think that there are cards not using X-Fi CA20K2 with better performance, I accept him/her sending me such a card for performance comparision.

My test configuration:

CPU:
- Intel Core2 Duo E8400 @ 3.0 GHz, FSB 1333 (333 QDR)
- Intel Core2 Duo E8400 @ 3.6 GHz, FSB 1600 (400 QDR)
Motherboard: Gigabyte EP45-UD3P
Mem: 4 GB DDR2/800
Graphics card: ATI Radeon HD 3870 from Gigabyte, Catalyst 9.6
Sound cards:
- onboard ALC889
- Creative X-Fi Titanium, using drivers from june 2009


My tests were made with the UT3 Benchmark tool from Guru3D, with DirectX10, max quality, sound on, max display resolution (1440 x 900). I did 5 runs of DM-ShangriLa map, without bots, with each card. After the first set of results, I've overclocked the CPU to 3.6 GHz, and I did a second set of benchmark runs. The average FPS are shown below.


X-Fi Titanium vs. Onboard Realtek 889 benckmark results

So far, I can tell that there is a 15% FPS gain only by using X-Fi Titanium instead ALC-889, and another important thing is that there is a higher performance gained overclocking the CPU when using X-Fi, since the CPU soes not need to handle all the workload needed for rendering audio.

I tought that, these days, the CPU power needed by audio on games is negligible, but I was wrong. Games using UT3 engine and/or OpenAL need a lot of CPU cycles to render audio, and using a hardware accelrated platform does squeeze maximum performance from other subsystems such as CPU and graphics card. In my test configuration, all the time when I ran the benchmarks, the CPU usage was 100%, making a CPU the limiting factor on this case. So, overclocking the CPU or using some hardware acceleration would help increasing gaming performance.

Doing some math, results that I need to overclock a Core2Duo by 0.6 x 4 = 2,4 GHz to release from the CPU the workload needed by audio processing in the same way X-Fi does in hardware with it's CA20K2, only to gain the same 15% FPS improvement. Also, I achived a higher framerate increase by overclocking when I used X-Fi, by 7.42%, which twice the gain achieved by overclocking the CPU and using onboard ALC889. Combining using an X-Fi Titanium instead onboard audio with some light overclock yelds a total framerate increase by 23,99%, which I consider 'high performance improvement' and 'worthy'.

Conclusion
That degree of performance increase may not be noticed by someone using a high clocked quad core CPU, but it does a big difference when the CPU has some limits, and such improvements cannot be achieved by overclocking. I can say that X-Fi titanium Fatal1ty does worth the money, and probably any CA20K2 X-Fi based sound card does, especially for gamers wanting to squeeze the maximum FPS from their platform, including those using the latest CPUs. But keep in mind another important thing: Unreal Tournament 3 engine is using OpenAL for audio rendering, and games using software for rendering cannot benefit from the acceleration provided by X-Fi, using only the CPU for this task.

Super ofertă la eMag!

Related Posts Plugin for WordPress, Blogger...