Typo 4.0 and memory reduction... 4
Have you upgraded to the latest Typo release only to find that it hits the per process memory limit on your host? It happened to me.
Here is how I went about reducing the memory footprint of Typo:
I will eventually be using a diferent theme but I switched to this one while checking out memory use and haven't spent enough time on my new one yet.
Here is how I went about reducing the memory footprint of Typo:
- Removed sidbars that aren't used from the installation.
- Amazon through XBox.
- Removed unused requires from environment.rb
- In particlular aggregation classes for the Sidebars that were removed.
- Make sure to not load any unnecessary parts of Rails (i.e. ActiveWebService) That's right I use the admin screen to post!
- Most importantly deleted the sparklines_textfilter.
I will eventually be using a diferent theme but I switched to this one while checking out memory use and haven't spent enough time on my new one yet.
environment.rb
...
Rails::Initializer.run do |config|
# Skip frameworks you're not going to use
# config.frameworks -= [ :action_web_service, :action_mailer]
config.frameworks -= [ :action_web_service]
...
# Also in the config.load.paths remove the line for actionwebservice
config.load_paths += %W(
vendor/rubypants
vendor/redcloth/lib
vendor/bluecloth/lib
vendor/flickr
vendor/syntax/lib
vendor/sparklines/lib
vendor/uuidtools/lib
vendor/jabber4r/lib
vendor/rails/railties
vendor/rails/railties/lib
vendor/rails/actionpack/lib
vendor/rails/activesupport/lib
vendor/rails/activerecord/lib
vendor/rails/actionmailer/lib
vendor/rails/actionwebservice/lib
).map {|dir| "#{RAILS_ROOT}/#{dir}"}.select { |dir| File.directory?(dir) }
...
# This is the other chunk with the aggregation classes
# Any that you are not using the sidebar for can safely be removed
$KCODE = 'u'
require_dependency 'jcode'
require_dependency 'aggregations/audioscrobbler'
require_dependency 'aggregations/delicious'
require_dependency 'aggregations/tada'
require_dependency 'aggregations/flickr'
/> require_dependency 'aggregations/fortythree'
require_dependency 'aggregations/magnolia'
require_dependency 'aggregations/upcoming'