Category Archives: Techy

.htaccess session timeout

For those who want to have a limited session time for each user, this is what you need to add on you .htaccess (3600 are seconds).

php_value session.cookie_lifetime 3600
php_value session.gc_maxlifetime 3600

For those who prefer it added to a PHP script, this is how

<?php
printf("cookie: %s, gc: %s", ini_get('session.cookie_lifetime'), ini_get('session.gc_maxlifetime'));

StagCMS Development System

Our development system is running in a

  • Single Core CPU
  • 512Mb RAM
  • 20Gb SSD disk
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 2
model name : QEMU Virtual CPU version 1.0
stepping : 3
microcode : 0x1
cpu MHz : 1999.999
cache size : 4096 KB
fpu : yes
fpu_exception : yes
cpuid level : 4
wp : yes
flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good nopl pni vmx cx16 popcnt hypervisor lahf_lm
bogomips : 3999.99
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:

Video convertion

I’m gonna let you guys some notes about video convertion on our production server.¬†Its a small server with one CPU, 512Mb of RAM running Ubuntu 13.04 / Linux 3.8.0-19-generic x86_64, with SSD disk.

The video is from Catie Minx, from the video gallery Car Fun. Thanks Mutt.
Its a video with the duration of 18 minutes and 22 seconds and a resolution of 640*480.

Without CPU limit
It took 20 minutes to convert from WVM to MP4 without loosing quality. (100%)
It took 14 minutes to convert from WMV to OGV without loosing quality. (70%)
It took 80 minutes to convert from WMV to WEBM without loosing quality. (300%)
Since OGV is supported by the same browsers that WEBM we won’t offer webm on the CMS.

We are working to improve.

Original WMV

WM/ToolName     : Flip4Mac WMV Export Component for QuickTime (Mac)
WM/ToolVersion  : 2211
Duration: 00:18:22.96, start: 0.000000, bitrate: 1722 kb/s
Stream #0.0(eng): Audio: wmav2, 48000 Hz, 2 channels, s16, 64 kb/s
Stream #0.1(eng): Video: wmv3 (Main), yuv420p, 640x480, 1651 kb/s, 29.97 tbr, 1k tbn, 1k tbc

Converted MP4

major_brand     : isom
minor_version   : 512
compatible_brands: isomiso2avc1mp41
encoder         : Lavf53.21.1
Duration: 00:18:23.06, start: 0.000000, bitrate: 5887 kb/s
Stream #0.0(eng): Video: h264 (Main), yuv420p, 640x480, 5682 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc
Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 199 kb/s

Some graphs

CPU usage

 

Memory usage

How to pick the right CDN for you?

ChinaCache – US / Europe CDN Map

From a huge list of CDN providers you will have to choose your wisely.

Basically there are two conditions on this mathematic equation – edges and prices -.
Your provider’s edges should be basically only near your visitors and/or clients. The more edges the CDN has, normally the more expensive it will be. So if your clients are 80% from the USA you should basically chose a provider with his networks oriented to USA. Why should you choose one with a well structured networks world wide? this will¬†affect the prices of the CDN and you wont need it.

CDNetworks – Global PoPs map 2013

This way you will need to search for the one that has more edges near your clients and not world wide.

Here’s a small list of them.

Some might not accept adult.

Backups, backups

by Daryl Mitchell – http://www.flickr.com/photos/daryl_mitchell/1199598508/sizes/m/

One of our friends is facing a HUGE problem at this moment.
His server had some kind of problem and he lost the content of his servers and his hosting company is having some troubles restoring the backups…

In the next version, we will introduce a automatic-backup solution that, has a GOOD backup should be, isn’t on the same physical place that your server is and will use TOP-NOCH hosting company.