簡體   English   中英

git push heroku master需要永遠

[英]git push heroku master takes forever

我正在使用基於Ubuntu 12.04(紅寶石1.9.2p290和rails 3.1.0)的VM,我的應用程序在本地完美運行。 我正在使用git,當我嘗試git push heroku master它不起作用:

git push heroku master

我得到:“計數對象:435,完成。壓縮對象:100%(215/215),完成。寫入對象:100%(435/435),73.35 KiB,完成。總計435(delta 171),重用435( delta 171)“

而且它永遠不會完成,因此它不會將任何內容推送到heroku。 終端永遠待命。 如果問題很明顯,我是heroku和git的新手:)

操作系統信息:

工作[1] +運行git push heroku master&

ps -x

PID TTY STAT時間命令

1078? SSL 0:00 gnome-session --session = ubuntu

1135? Sl 0:00 / usr / bin / VBoxClient-剪貼板

1147? Sl 0:00 / usr / bin / VBoxClient-顯示

1154年? Sl 0:00 / usr / bin / VBoxClient-無縫

1162年? Sl 0:19 / usr / bin / VBoxClient --draganddrop

1167? Ss 0:00 / usr / bin / ssh-agent / usr / bin / dbus-launch --exit-with-s

1171年? S 0:00 / usr / bin / dbus-launch --exit-with-session gnome-sessio

1172? SS 0:01 // bin / dbus-daemon --fork --print-pid 5 --print-addres

1246? Sl 0:00 / usr / bin / gnome-keyring-daemon --start --components = se

1250? Sl 0:02 / usr / lib / gnome-settings-daemon / gnome-settings-daemon

1329年? S 0:00 / usr / lib / gvfs / gvfsd

1334年? Sl 0:00 / usr / lib / gvfs // gvfs-fuse-daemon -f /home/ubuntu/.gvfs

1401嗎? Sl 0:03變態

1417年? S 0:00 / usr / lib / i386-linux-gnu / gconf / gconfd-2

1421? 小號

1426年? Sl 0:01 unity-2d-panel

1427? Sl 0:07 unity-2d-shell

1430年? S 0:00 / usr / lib / pulseaudio / pulse / gconf-helper

1447? Sl 0:01 / usr / lib / bamf / bamfdaemon

1450年? Sl 0:00 / usr / lib / gnome-settings-daemon / gnome-fallback-mount-h

1453? Sl 0:02鸚鵡螺-n

1455年? Sl 0:00 / usr / lib / policykit-1-gnome / polkit-gnome-authenticatio

1457? SL 0:00藍牙小程序

1468嗎? Sl 0:00 nm小程序

1482? S 0:00 / usr / lib / gvfs / gvfs-gdu-volume-monitor

1500? Sl 0:00 / usr / lib / gvfs / gvfs-afc-volume-monitor

1504年? S 0:00 / usr / lib / gvfs / gvfs-gphoto2-volume-monitor

1518年? S 0:00 / usr / lib / gvfs / gvfsd-trash --spawner:1.9 / org / gtk / gvf

1521年? Sl 0:01 / usr / lib / unity / unity-panel-service

1523? Sl 0:00 / usr / lib / dconf / dconf-service

1539? Sl 0:00 / usr / lib / indicator-datetime / indicator-datetime-servic

1541? Sl 0:00 / usr / lib / indicator-printers / indicator-printers-servic

1543? Sl 0:00 / usr / lib / indicator-messages / indicator-messages-servic

1545年? S1 0:00 / usr / lib / indicator-session / indicator-session-service

1547年? Sl 0:00 / usr / lib / indicator-application / indicator-application-

1549年? Sl 0:00 / usr / lib / indicator-sound / indicator-sound-service

1574年? S 0:00 / usr / lib / geoclue / geoclue-master

1591年? S 0:00 / usr / lib / ubuntu-geoip / ubuntu-geoip-provider

1597? Sl 0:00 / usr / lib / gnome-disk-utility / gdu-notification-daemon

1603年? S 0:00 / usr / lib / gvfs / gvfsd-metadata

1609年? Sl 0:00 / usr / lib / indicator-appmenu / hud-service

1620年? Sl 0:00 / usr / lib / unity-lens-applications / unity-applications-d

1622年? Sl 0:00 / usr / lib / unity-lens-files / unity-files-daemon

1624年? Sl 0:00 / usr / lib / unity-lens-music / unity-music-daemon

1626年? Sl 0:00 / usr / bin / python / usr / lib / unity-lens-video / unity-lens-

1653年? Sl 0:00 / usr / bin / zeitgeist-daemon

1661年? Sl 0:00心靈感應指示器

1668年? Sl 0:00 / usr / lib / zeitgeist / zeitgeist-fts

1672年? Sl 0:00 Zeitgeist-datahub

1676年? 小0:00 / bin / cat

1682年? Sl 0:00 / usr / lib / telepathy / mission-control-5

1701嗎? Sl 0:00 gnome屏幕保護程序

1703年? Sl 0:00 / usr / bin / python / usr / lib / unity-scope-video-remote / uni

1728年? Sl 0:05 gnome-terminal

1734年? S 0:00 gnome-pty-helper

1738 pts / 2 Ss 0:00 bash

1796年? Sl 0:00更新通知程序

1954 pts / 2 S 0:00 git push heroku master

1955 pts / 2 S 0:00 ssh git@heroku.com git-receive-pack'polar-island-471

1959點/ 2 R + 0:00 ps -x

推送到Heroku可以超時的原因有很多。 根據我的經驗,最常見的原因是由於網站大小和網站大小,我的意思是3件事:你的git倉庫的大小,你的網站大小被推送到Heroku(git repo - 被忽略的文件),以及您使用的寶石的大小。 Heroku在容納大型站點(或者長時間運行的進程)方面並不是特別強大,如果你變得太大,你可能會導致你的推送暫停/超時和間歇性,這可能是令人困惑的。

.git文件夾我讓網站變得無法解釋地大,並且隨着時間的推移,我看到項目根目錄中的.git文件夾已經增長到600mb。 謝天謝地,我在heroku部署聊天中注意到一個警告,警告我git repo太大。 無論如何,由於該文件夾是由git在后台管理的,所以我最終開始了一個新的git repo並將代碼移到該文件夾​​中,這使我的網站縮小了90%。

.slugignore導致我的站點變得足夠大以至於超時的另一個陷阱是允許將日志,臨時目錄和solr索引目錄等內容包含在項目中。 在我的.slugignore文件中排除了所有這些文件夾后,推送變得非常快。 是的,你可以使用.gitignore獲得相同的基本效果,但有些東西我喜歡通過git管理,但在推送到heroku時會忽略。 那時候.slugignore派上用場了。

gems通過完成上述步驟,我將網站縮小到合理的大小,但偶爾也會超時。 然后,我意識到寶石也對您的網站規模有所貢獻。 所以我從我的gemfile中刪除了一些未使用的寶石,並且我能夠將我的slug編譯時間從900秒減少到250秒,並且我的總體部署時間從15分鍾以上,頻繁超時到10分鍾以下。 對於每次部署而言不必等待這么長時間並且冒出一半時間的風險超時,這是多么輕松。

根據您的特定設置,所有這些因素中的任何一個或全部都可能確實傷害您。 就我而言,我做錯了一切。 但是,即使您沒有超時,您仍可能希望盡可能地修剪您的網站以縮短部署時間。

如何使heroku不吮吸 http://www.stormconsultancy.co.uk/blog/development/6-ways-to-get-more-bang-for-your-heroku-buck-while-making-your-rails-現場超活潑的/

原因是,我的連接非常慢。 那是我的智能手機的接入點。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM