Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
Faster PHP server CSI package
08-06-2009, 10:55 PM (This post was last modified: 09-06-2009 11:21 PM by journey4712.)
Post: #1
Faster PHP server CSI package
Greetings !

I've put together a CSI package that is capable of replacing the php5 apache webserver that most php CSI applications run through. Thanks to some work by Ger Teunis with the appinit installer lighttpd is now able to replace the csi webserver on port 9999. This means you use all the same url's to access your nmt programs, they just run faster.

lighttpd-1.4.23-nmt1.zip

This package includes lighttpd 1.4.19, php 5.2.8, and APC 3.1.2. The result of this package is that php scripts are compiled once and then stored in memory with the php interpreter between requests. This reduces disk access, time needed to compile, and time needed to setup the request. To save memory APC has been dropped from a 32MB opcode cache to 8MB. This package also includes the openssl, zlib, gd, xslt, and xdebug(disabled by default) php extensions to allow application developers to do more.

In my testing this package drastically increases the speed of a php 5 application on the NMT

journey4712

EDIT:
Changelog
1.4.23-nmt1
update lighttpd to 1.4.23
add patch to allow file read failover to non-mmap (fixes access to files on samba shares)
-nmt10
update APC to 3.1.3p1
fix run-time linking
-nmt9
add freetype and jpeg support to gd php extension
-nmt8
attempt to fix run-time linking
-nmt7
add xslt php extension
-nmt6
add sockets extension that was in origional nmt php interpreter(fixes btpd)
add openssl extension to php to support https
-nmt5
disable appinit webserver and replace it on port 9999
added xdebug extension(disabled by default) to allow developers to profile/debug code on the nmt
-nmt4
added gd(and libpng12) and zlib modules to php
include apc stats: http://ip-of-pch:9990/lighttpd_web/apc.php
-nmt3
added xsl mimetypes
repoint php socket to /share/Apps/lighttpd/run/php.socket
-nmt2
added xml mime types
-nmt1:
first release

Automated TV Downloads | On-Demand Network Shares | Faster PHP (lighttpd+fastcgi+apc)
PCH-A100 | PCH-C200 | XBMC HTPC | Sharp Aquos 42D62U | Logitech Z-5500
Find all posts by this user
Add Thank You Quote this message in a reply
[+] 6 users say Thank You to journey4712 for this post
08-06-2009, 11:46 PM
Post: #2
RE: Faster PHP server CSI package
That look really cool! Smile

Do you replace the server or you package run side by side with the original httpd ?

@+
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 12:04 AM (This post was last modified: 08-21-2009 11:54 PM by journey4712.)
Post: #3
RE: Faster PHP server CSI package
It runs side by side on a different port, 9990.

journey4712

EDIT
While this was originally true as of the -nmt5 version lighttpd now replaces the apache server on port 9999

Automated TV Downloads | On-Demand Network Shares | Faster PHP (lighttpd+fastcgi+apc)
PCH-A100 | PCH-C200 | XBMC HTPC | Sharp Aquos 42D62U | Logitech Z-5500
Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 12:07 AM
Post: #4
RE: Faster PHP server CSI package
ok, I will try it.

Thank journey4712.
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 01:07 AM
Post: #5
RE: Faster PHP server CSI package
Journey, nice job Cool

Have you playing 1080p mkv movies after installing your package?
I wonder if the memory usage used by this would further hurt or actually benefit 1080p playback,
especially in conjunction with the use of a movie jukebox.
Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 01:28 AM (This post was last modified: 08-07-2009 01:46 AM by journey4712.)
Post: #6
RE: Faster PHP server CSI package
While i havn't tried playing 1080p's, it shouldn't affect things any more than the apache setup. For example cat /proc/12345/status (for an apache httpd process) reports 39M vmsize, lighttpd reports 3.2M with another 20M for the php interpreter+opcode cache. I cant say with any certainty though that using this will use less/more memory.

This of course only works with the internal hard disk installed, so un-accessed memory should get cached out to swap if neccessary. Currently with apache and lighttpd running but not in use, lighttpd is reporting 800k of its memory not swapped out, with another 1.2M for
php. Also note that reported memory can be hard to truly compare, as these numbers also include any loaded shared libraries.

Best bet would seem to just test it out, see if any issues arrise. I've had 2 other people test this package before posting it here and havn't had any reports of issues, best i can say.

journey4712

Automated TV Downloads | On-Demand Network Shares | Faster PHP (lighttpd+fastcgi+apc)
PCH-A100 | PCH-C200 | XBMC HTPC | Sharp Aquos 42D62U | Logitech Z-5500
Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 06:34 AM
Post: #7
RE: Faster PHP server CSI package
Excellent work journey4712!
I have to think about an option to offer this application more prominent while using CSI or even use it by default for new AppInit installations.

One little remark, could you remove the last comma on the last line on appinfo.json file?
This comma causes the php json parser of "CSI Gaya" to incorrectly parse the information.

Easy way of installing software on your NMT using just your mouse: NMT Community Software Installer
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 07:23 AM
Post: #8
RE: Faster PHP server CSI package
Ok i fixed up that line in appinfo. Not really a noticable change so i just overwrote the file already up for download(so same link). I guess i'm just too used to writing php arrays with commas at the end Smile

journey4712

Automated TV Downloads | On-Demand Network Shares | Faster PHP (lighttpd+fastcgi+apc)
PCH-A100 | PCH-C200 | XBMC HTPC | Sharp Aquos 42D62U | Logitech Z-5500
Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 08:41 AM
Post: #9
RE: Faster PHP server CSI package
(08-07-2009 07:23 AM)journey4712 Wrote:  Ok i fixed up that line in appinfo. Not really a noticable change so i just overwrote the file already up for download(so same link). I guess i'm just too used to writing php arrays with commas at the end Smile

I do that all the time as well.
I'll add this package to the repository this evening, we could also grab this opportunity to hookup your repository again if you like, or do you want to wait for the next 'torrentwatch' release?

Easy way of installing software on your NMT using just your mouse: NMT Community Software Installer
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 08:49 AM
Post: #10
RE: Faster PHP server CSI package
I just installed FileManager the other day, and it uses port 9999 and required the activation of the miIHome service. So if I install this one, not only would FileManager benifit speedwise, but I can again deactivate myiHome?
Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 08:55 AM
Post: #11
RE: Faster PHP server CSI package
(08-07-2009 08:49 AM)vaivel Wrote:  I just installed FileManager the other day, and it uses port 9999 and required the activation of the miIHome service. So if I install this one, not only would FileManager benifit speedwise, but I can again deactivate myiHome?

myIhome is not required to run CSI websites.
Perhaps after you stop myihome you'll need to restart the NMT but CSI is not dependent on myIhome.

Easy way of installing software on your NMT using just your mouse: NMT Community Software Installer
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 09:19 AM
Post: #12
RE: Faster PHP server CSI package
Well to answer some of my own questions, 9999 is aparently not the myiHome service, my mistake, it must be for some other purpose that it is a FileManager requirement. That aside, FileManager does not work on this, it gives a lot of XML errors at startup, navigation works in the left panel, but nothing works in the right.

I had more success running Transmission_gaya on 9990, both on the PCH and on my PC browser (no I dont usually do that, but as a poof of concept).
Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 10:41 AM (This post was last modified: 08-07-2009 10:42 AM by journey4712.)
Post: #13
RE: Faster PHP server CSI package
@vaivel
Hmm, i may have missed on on some compiled in modules that are default on the nmt. I will look into this.

@ger_teunis
i'm working on getting that file corrected, and the 3 applications all pointing to the right stuff(mono.wrapper, torrentwatch(old version still, but with CSI based install), and lightpd) and i'll let you know, hopefully i get it right this time arround Smile

journey4712

Automated TV Downloads | On-Demand Network Shares | Faster PHP (lighttpd+fastcgi+apc)
PCH-A100 | PCH-C200 | XBMC HTPC | Sharp Aquos 42D62U | Logitech Z-5500
Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 03:08 PM
Post: #14
RE: Faster PHP server CSI package
Ok, file manager actualy just didn't like the default content-type and wanted a proper response. I didn't really use a full configuration file just the basics, i've added xml to the list of mimes and uploaded a new package.

http://nmtdvr.com/downloads/lighttpd-1.4.19-nmt2.zip

journey4712

Automated TV Downloads | On-Demand Network Shares | Faster PHP (lighttpd+fastcgi+apc)
PCH-A100 | PCH-C200 | XBMC HTPC | Sharp Aquos 42D62U | Logitech Z-5500
Find all posts by this user
Add Thank You Quote this message in a reply
08-07-2009, 03:52 PM
Post: #15
RE: Faster PHP server CSI package
Havent found any problems with FileManager, and it sure makes it quite a bit more responsive. Great work!
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Serviio (DLNA server) RXP 3 4,325 12-30-2012 11:14 AM
Last Post: mikk
  ftp server and upload images from ipcam defer 8 7,473 02-11-2012 04:48 PM
Last Post: vanquish99
  HTTP streaming server on A110 ? dony71 0 1,995 01-26-2012 02:48 AM
Last Post: dony71
  A-110 used like server db to store sensor data csorda 0 1,529 01-18-2012 04:06 PM
Last Post: csorda
Music fuppes 0.629 for NMT - dlna, upnp media server [UPDATED: 31-May-2009] Mr Segfault 53 54,698 10-12-2011 01:04 AM
Last Post: spud
  OpenSSH for SFTP server? dony71 0 1,151 09-30-2011 05:32 AM
Last Post: dony71
  web server manifest support harrykausl 0 1,558 07-20-2011 09:35 AM
Last Post: harrykausl
  Help with Server Timeout Error running a script hindibuff 0 2,154 03-29-2011 06:21 AM
Last Post: hindibuff
Bug Executing a script on the server from the NMT? johnk 6 4,148 02-21-2011 10:59 PM
Last Post: johnk
  Popcorn does not see Twonky or PS3 Media Server rgn2000 0 3,980 09-02-2010 09:14 PM
Last Post: rgn2000

Forum Jump: