Welcome to another edition of apnscp changes!  Important changes include Rails infrastructure changes from Ruby 1.8 + FastCGI to Ruby 1.9 + mod_rails, new multiple worker backend (apnscpd), CDN to distribute static content with minimal bandwidth overhead (http://getap.is), and an aggressive caching  framework to reduce bottlenecks.


After several custom patches, mod_rails is a possibility for our clients.  mod_rails provides the same great, secure setup experienced with FastCGI, but without the nasty suexec headaches.  Perform an upgrade from Ruby 1.8 via Development > Code Frameworks.  Gems will be migrated to Ruby 1.9 during the upgrade process.  After upgrading add the necessary .htaccess directives found in the Rails Quickstart

Ruby 1.9 is here
Ruby 1.9 is here

Easy Task Scheduling (@token)

Another nice feature coming on the heels of a planned server outage is support for crontab @ time tokens.   @reboot executes a task on start-up, which obsoletes rc.d support, @hourly executes once per hour, @daily, @weekly, @monthly, and @yearly are additional special times recognized by crontab.  Each scheduling time is guaranteed to execute once during an interval, but the minute/hour vary.  Both minutes (@hourly/…/@yearly) and hours (@daily/…/@yearly) are evenly distributed among all accounts to prevent CPU bottlenecks caused, for example, by multiple hourly tasks occurring at 12:00 AM, 1:oo AM, 2:00 AM…

New Crontab Interface
New Crontab Interface

apnscpd multi-tasking backend

Finally, the nicest improvement, based upon effort, includes a bevvy of performance optimizations culminating with a client-server replacement for the single-user privileged processor necessary for carrying out filesystem management of the account… that forked on every single privileged request.  For example, loading up the File Manager may generate as many as 5 separate forks of the privileged processor “lservice” [this name is about as old as the concept apnscp itself].  Now a master distributes work to one of several concurrent workers awaiting further instruction.  Best of all no additional forking required unless a worker dies on the job.   Another area of concern included sharing caches between the privileged processor and UI.  This was solved by implementing multi-tiered memcached framework.

As a comparative benchmark, requesting directory contents within the File Manager has decreased from 250 ms per request to 17 ms – a 14x improvement.  Speeding up code wasn’t enough.  Static content is now offloaded to a separate CDN (http://getap.is – clever?) to eliminate cookies, add caching, and reduce bandwidth overhead too.  Overall the latest set of changes should produce a noticeable improvement in responsiveness and allow you to get things done faster than ever before.

Assuming that spiel wasn’t enough to put you to sleep, here is your night cap in the form of a changelog:

  • NEW: Ruby 1.9
  • NEW: Util_Process_Tee – read from program standard input, write to external file (replaces built-in tee from Module Skeleton)
  • NEW: account delete/edit hooks
  • NEW: unified global/account/session cache support shared between UI and privileged processor
  • NEW: multi-process privileged processor framework, 8x throughput improvement, handles multiple requests concurrently (apnscpd)
  • NEW: delete Urchin profiles/log sources (Urchin)
  • NEW: stream multiple commands to privileged processor (DataStream)
  • NEW: recompose()- build regular expressions from multiple subexpressions (REGEX)
  • NEW: user preferences (UCard)
  • NEW: FTP bandwidth usage
  • NEW: Styled, scrollable control with mousewheel support based upon jQuery Slider (Manage MySQL)
  • NEW: raw PHP code interpreter (CLI)
  • FIX: 201X backup rotation (Database Backup)
  • FIX: printf named argument parsing (%(foo)s, %(bar)d) (Process)
  • FIX: path transation corruption (File)
  • FIX: bogus worker starvation response (apnscpd)
  • FIX: Mode fixation on first auth handler triggered on start (Auth)
  • FIX: non-interactive auth requests fail (Auth::CLI)
  • FIX: session fixation (Auth)
  • FIX: reset buffer status during worker initialization (apnscd)
  • FIX: ftp usernames reported as site id (Bandwidth Logging)
  • FIX: escape shell special characters in Urchin passwords
  • FIX: apnscp version is not cached due to incorrect key (Page Template)
  • FIX: backtrace argument corruption (Error Reporter)
  • FIX: purge file metadata cache on chmod/chown (File)
  • FIX: Modifying DNS cache duplicates parameter values consisting of multiple, space-delimited tokens (DNS)
  • FIX: interrupt user creation process if usermod fails (User)
  • FIX: multiple billing invoices result in malformed query (Billing)
  • FIX: Profile changes result in “invalid token” error (Client Referrals)
  • FIX: DNS fails to propagate on multi-homed accounts (DNS)
  • FIX: uninitialized class reference in logfile callback (Add Subdomain)
  • FIX: IE6 modal header formatting (Modal)
  • FIX: refer to forms explicitly by name rather than position (SPF Wizard, Addon Domains)
  • FIX: action icons are hidden in IE7 (CSS)
  • CHG: result from apnscpd query returns return value instead of an object consisting of the return value among other unused flags (DataStream)
  • CHG: support multiple domains (FrontPage)
  • CHG: size-based rotation defaults to MB (Logrotate)
  • CHG: expand crontab times to accept hourly/daily/weekly/monthly/yearly/startup task times (Cronjob)
  • CHG: RESET flag flushes worker cache before processing a job (apnscpd)
  • CHG: sudo uid no longer mandatory, defaults to current uid of worker (Process::Sudo)
  • CHG: increase socket read buffer from 4k to 8k (apnscpd)
  • CHG: permit multiple A/AAAA DNS records for a given subdomain/RR (DNS)
  • CHG: Add reset flag to force apnscpd session reinitialization (DataStream)
  • CHG: dump auth profile instead of session data since class data is now extensively cached within sessions generating enormous bug reports (Error Reporter)
  • CHG: move archive extensions out of the constructor to enable archive recongition between cached module deserialization routines (File)
  • CHG: Performance: remove call_user_func_array() and invoke afi::__call() directly
  • CHG: Performance: save loaded modules between page requests (afi)
  • CHG: add deferrable/non-deferrable Javascript (Template)
  • CHG: notify if upgrade for Rails is available (Code Frameworks)
  • CHG: Reduce module skeleton footprint.  Migrate call_proc* functions to Util_Process_* classes, pam_* to Util_Pam, break inheritance from DataStream (Module Skeleton)
  • CHG: Page load improvements: use CDN for static assets, move /libjs to /js, flush HEAD immediately (Template)
  • CHG: Rename file_create_symlink to file_symlink (File)
  • CHG: adding a DNS record with no parameter raises an error (DNS)
  • CHG: Performance: lazy load class name changes (Conf::Util, Process)
  • CHG: Performance: optimize filesystem stat cache flushing frequency (File)
  • CHG: Performance: determine account info freshness from domain info mtime (Account Info)
  • CHG: Performance: cache get_users() response (User)
  • CHG: Performance: reset account metadata on login if current/ mtime does not match saved value (Auth::Account Info)
  • CHG: migrate user/account information to separate objects (User_Info, Account_Info)
  • CHG: check if database exists before creation (SQL)
  • CHG: sort search results based upon page view frequency (Search)
  • CHG: clarify formatting of password reset e-mail
  • CHG: show full help on first page view (Page Template)
  • CHG: Performance: stat()- cache all directory entries on first run to improve response of related directory queries (File)
  • CHG: cleanup aliases module
  • CHG: obsolete common_*news* news functions, use http://updates.apisnetworks.com (Common)
  • CHG: extract()- skip chown operation on empty archives (File)
  • CHG: Ignore deprecation notice in Net/Whois.php (DNS)
  • CHG: Separate MySQL Manager into 2 distinct views, populate only active user/database editor metadata (MySQL Manager)
  • CHG: cacheless session switching between clients (CLI)
  • CHG: redirect /favicon.ico to /images/favicon.ico for broken browsers
  • CHG: update upload progress bar to apnscp 2 (File Upload)
  • CHG: disable postback indicator triggered on login via session id (Dashboard)
  • CHG: remove tooltip MySQL cache as it is now part of the short-term session cache
  • REM: italicized property from hinted input elements (CSS)
  • REM: get_php_version()- PHP4 information (Common)
apnscp Update: performance improvements, mod_rails, Ruby 1.9, over 75 changes!