在网络驱动器上编辑代码时如何避免暂停?

发布于 2024-07-04 16:50:09 字数 298 浏览 8 评论 0原文

我计划在家中进行更多编码,但为此,我需要能够编辑开发服务器上 Samba 驱动器上的文件。 我在使用几个编辑器时遇到的问题是网络延迟导致编辑器长时间锁定(Eclipse、TextMate)。 有些编辑器比其他编辑器能更好地处理这个问题,但是我可以做任何文件系统或其他调整来最大程度地减少延迟的影响吗?

其他几点:

  • 有一项政策禁止在个人计算机上保存公司数据,因此我想避免在本地检查代码。
  • 该安装通过 PPTP VPN 连接进行。
  • 安装到 Linux 或 OS X 客户端

I'm planning on doing more coding from home but in order to do so, I need to be able to edit files on a Samba drive on our dev server. The problem I've run into with several editors is that the network latency causes the editor to lock up for long periods of time (Eclipse, TextMate). Some editors cope with this a lot better than others, but are there any file system or other tweaks I can make to minimize the impact of lag?

A few additional points:

  • There's a policy against having company data on personal machines, so I'd like to avoid checking out the code locally.
  • The mount is over a PPTP VPN connection.
  • Mounting to Linux or OS X client

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

原谅我要高飞 2024-07-11 16:50:09

简短的回答:你没有办法。 CIFS 确实适合流量相当平静的 LAN,因此您通过 VPN 访问共享时不遭受间歇性延迟的可能性为零。 编辑器在某些时候需要以阻塞 IO 方式访问文件,因为否则没有任何实际意义。

您可以切换编辑器并使用 Emacs + TRAMP,它适合处理远程文件。

Short answer: you can do no trick. CIFS is really geared towards LAN with a reasonably calm trafic, so you have zero chance to not suffer intermittent lag accessing a share through a VPN. The editor at some point needs to access the file in blocking IO, because it makes no real sense to do otherwise.

You could switch editor and use Emacs + TRAMP which is geared to work on remote files.

节枝 2024-07-11 16:50:09

如果您从个人计算机访问数据,则数据位于 RAM 中,因此我们假设您无法将其存储在硬盘驱动器、软盘、USB 记忆棒等上。

您的解决方案是 RAM 驱动器。 使用您喜欢的任何方法(我建议源代码控制)复制您需要编辑的文件,然后您可以毫无延迟地编辑它们。 完成后将它们提交回服务器。

正如所指出的,您的编辑器可能正在缓存对临时目录的更改,甚至可能是您的交换文件(如果它在内存中,那么它可以被换出)。 解决方案是使用更大的 RAM 驱动器并在 RAM 驱动器中运行虚拟机。 不确定您正在运行什么操作系统,但如果您所做的只是编辑源代码,那么您可以获得大多数操作系统的相当精简的安装。

如果你没有足够的 RAM,那么购买一个 Gigabyte i-RAM 固态硬盘并取出电池,这样当你断电时它就会失去一切。

将 VMWare 设置为不允许操作系统交换任何虚拟机。 在硬盘驱动器上保留一个基准虚拟机,并在启动之前将其复制到 RAM 驱动器。 然后你就可以像使用硬盘一样使用VM中的硬盘了,尽管它是RAM。

在断电之前对 RAM 驱动器运行安全擦除可能是个好主意。 另请记住,他们发现,如果您在将 RAM 芯片从正常运行的计算机中取出之前对其进行超级冷却,然后足够快地将其放入新计算机中,则数据可能仍然完好无损。

我想这一切都取决于该政策的详细程度以及如何解释它。

祝你好运!

If you are accessing the data from your personal computer, it is in your RAM, so we will assume that you just can't store it on your hard drive, floppy, USB stick, etc.

Your solution is a RAM drive. Copy the files you need to edit there using whatever method you prefer (I would suggest source control) and then you can edit them without lag. When you are done commit them back to the server.

As was pointed out your editor may be caching changes to your temp directory, or maybe even your swap file (if it is in memory, then it can get swapped out). The solution to that is get a much larger RAM drive and run a Virtual Machine in the RAM drive. Not sure what OS you are running, but you can get a pretty slim install of most OS's if all you are doing is editing source code.

If you don't have enough RAM, then get a Gigabyte i-RAM solid state drive and remove the battery, that way it will lose everything when you power down.

Set your VMWare to not allow the OS to swap any of the virtual machine. Keep a baseline VM on your hard drive and copy it to your RAM drive before booting it up. Then you can use the hard drive in the VM like a hard drive, even though it is RAM.

Might be a good idea to run a secure erase on your RAM drive before powering down. Also keep in mind that they have found if you super cool a RAM chip before removing it from a functioning computer, and place it in a new computer quick enough, the data may still be intact.

I guess it all comes down to how detailed that policy is, and how it is interpreted.

Good luck!

流云如水 2024-07-11 16:50:09

Remate 插件只是禁用了这个可怕的焦点刷新功能。

下载、解压、双击并从“窗口”菜单中选择“重新获得焦点时禁用刷新”(您可以通过右键单击抽屉中的项目来手动刷新)。 瞧!

Remate plugin simply disables this dreadful refresh-on-focus feature.

Download, unpack, doubleclick and choose "Disable Refresh on Regaining Focus" from "Window" menu (you can refresh manually by right-clicking project in drawer). Voila!

大姐,你呐 2024-07-11 16:50:09

使用源代码控制系统 — Subversion、Perforce、Git、Mercurial、Bazaar 等 — 这样您就永远不会在共享服务器上编辑代码。 相反,您应该编辑本地工作区域并将更改提交到位于网络上的存储库。

此外,说服您的公司调整其策略,以便公司代码可以在个人计算机上(如果)位于加密卷上。 为此,您可以使用“磁盘工具”轻松创建加密磁盘映像,并且可以使用强加密技术。 通过不在钥匙串中存储加密密码,而是在每次安装加密卷时键入它,您可以获得更高的安全性; 这意味着即使您的本地用户帐户受到威胁,只要您没有安装该卷,其他人就无法安装它。

当我做咨询时,我一直这样做,一旦我解释了事情是如何运作的,我的客户(其中一些对公司代码有类似的规则)都没有遇到过问题。 (我认为他们中的一些人甚至开始在办公室内使用加密的磁盘映像。)

Use a source control system — Subversion, Perforce, Git, Mercurial, Bazaar, etc. — so you're never editing code on a shared server. Instead you should be editing a local work area and committing changes to a repository located on the network.

Also, convince your company to adapt their policy such that company code is allowed on personal machines if it's on an encrypted volume. Encrypted disk images that you can use for this are trivial to create using Disk Utility, and can use strong cryptography. You can get even more security by not storing your encryption passphrase in your keychain, and instead typing it every time you mount the encrypted volume; this means that even if your local user account is compromised, as long as you don't have the volume mounted, nobody else will be able to mount it.

I did this all the time when I was consulting and none of my clients — some of whom had similar rules about company code — ever had a problem with it once I explained how things worked. (I think some of them even started using encrypted disk images even within their offices.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文