~stub/charms/precise/postgresql/py3

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: Stuart Bishop
  • Date: 2014-04-04 11:52:12 UTC
  • mfrom: (81.1.64 replication)
  • Revision ID: stuart.bishop@canonical.com-20140404115212-penexdfdtf2kq81b
Merged replication into use-charm-helpers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
449
449
        config_data['listen_port'] = get_service_port()
450
450
    if config_data["performance_tuning"].lower() != "manual":
451
451
        total_ram = _get_system_ram()
452
 
        if not config_data["effective_cache_size"]:
453
 
            config_data["effective_cache_size"] = \
454
 
                "%sMB" % (int(int(total_ram) * 0.75),)
455
 
        if not config_data["shared_buffers"]:
456
 
            if total_ram > 1023:
457
 
                config_data["shared_buffers"] = \
458
 
                    "%sMB" % (int(int(total_ram) * 0.25),)
459
 
            else:
460
 
                config_data["shared_buffers"] = \
461
 
                    "%sMB" % (int(int(total_ram) * 0.15),)
462
452
        config_data["kernel_shmmax"] = (int(total_ram) * 1024 * 1024) + 1024
463
453
        config_data["kernel_shmall"] = config_data["kernel_shmmax"]
464
454