python - How to run code that needs too much RAM on OpenShift? -


i have problem openshift. trying add django_geoip django app. however, when try initialize database, openshift kills it. think needing memory.
if run update code ./manage.py geoip_update(i tried running nohup), output:

downloading zipfile ipgeobase.ru... info:import:downloading zipfile ipgeobase.ru... extracting files... info:import:extracting files... updating locations... info:import:updating locations... updating cidr... info:import:updating cidr... 61% 

after 61% of cidr update crashes. if following log or logged in through ssh, disconects me:

/var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/ruby_compat.rb:30:in `select': closed stream (ioerror) /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/ruby_compat.rb:30:in `io_select' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/packet_stream.rb:75:in `available_for_read?' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/packet_stream.rb:87:in `next_packet' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:183:in `block in poll_message' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:178:in `loop' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/transport/session.rb:178:in `poll_message' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:461:in `dispatch_incoming_packets' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:222:in `preprocess' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:206:in `process' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `block in loop' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `loop' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh/connection/session.rb:170:in `loop' /var/lib/gems/1.9.1/gems/rhc-1.36.4/lib/rhc/ssh_helpers.rb:198:in `block in ssh_ruby' /var/lib/gems/1.9.1/gems/net-ssh-2.9.2/lib/net/ssh.rb:215:in `start' /var/lib/gems/1.9.1/gems/rhc-1.36.4/lib/rhc/ssh_helpers.rb:173:in `ssh_ruby' /var/lib/gems/1.9.1/gems/rhc-1.36.4/lib/rhc/commands/tail.rb:40:in `tail' /var/lib/gems/1.9.1/gems/rhc-1.36.4/lib/rhc/commands/tail.rb:21:in `run' /var/lib/gems/1.9.1/gems/rhc-1.36.4/lib/rhc/commands.rb:294:in `execute' /var/lib/gems/1.9.1/gems/rhc-1.36.4/lib/rhc/commands.rb:285:in `block (3 levels) in to_commander' /var/lib/gems/1.9.1/gems/commander-4.2.1/lib/commander/command.rb:180:in `call' /var/lib/gems/1.9.1/gems/commander-4.2.1/lib/commander/command.rb:180:in `call' /var/lib/gems/1.9.1/gems/commander-4.2.1/lib/commander/command.rb:155:in `run' /var/lib/gems/1.9.1/gems/commander-4.2.1/lib/commander/runner.rb:421:in `run_active_command' /var/lib/gems/1.9.1/gems/rhc-1.36.4/lib/rhc/command_runner.rb:72:in `run!' /var/lib/gems/1.9.1/gems/commander-4.2.1/lib/commander/delegates.rb:12:in `run!' /var/lib/gems/1.9.1/gems/rhc-1.36.4/lib/rhc/cli.rb:37:in `start' /var/lib/gems/1.9.1/gems/rhc-1.36.4/bin/rhc:20:in `<top (required)>' /usr/local/bin/rhc:23:in `load' /usr/local/bin/rhc:23:in `<main>' 

i guess heavy memory usage. tried empty database , deleted log files sure not capacity problem(disk quota exceeded).
question is: how run command make work? may somehow limit needed resources?

well found out caused geoip creating django_geoip_iprange table, has around ~218 000 records. geoip loads these ips memory , stores them database. able import table django_geoip_iprange localhost, django_geoip should functional now.
additionally, should able use ulimit limit resources required. did not test yet.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -