yuu_nkjm blog


2010-04-13(Tue) 編集

[Linux] SCPとSFTPの比較

普段ファイル転送にはWinSCPを使っているのですが,「もう少し速くならんもんかね?」と思っていた.SCPとSFTPってプロトコルが選べるけど,速度はそんなに違うものなのかなと思い確認してみた.

まず現在の環境で実測してみることにした.3GBのisoファイルをサーバに置いて,WinSCPをクライアントとしてダウンロードを行った.この時,プロトコルにSFTPを使うと2.0MB/secぐらい,SCPを使うと4.5MB/secぐらい出た.

他にどういう特徴があるのかなと思い,WinSCP :: Supported Transfer Protocolsを見てみた.

  • SFTPはセキュアなFTPということで,FTPで使える機能(例えば,レジューム機能)などが使える.
  • 高機能なファイル転送が必要ないなら,SCPの方が速い
  • 自分がいつか討ち取られそうなポイントとしては,SCPの転送ファイルの制限が4GBってところ(Does not support files over 4 GiB (32-bit boundary))
Feature SFTP FTP SCP
Speed Generally slowest (encryption and necessity to wait for packet confirmations). Generally fastest file transfer (no encryption and efficient file transfer), yet transfer setup is slow, so transfer of large number of small files can be slow. Medium (encryption, but efficient file transfer, yet it does not allow the transfer to be interrupted).
Transfer resume Supported. WinSCP supports resuming only since SFTP-2 (which introduces rename command). Supported. Unsupported.
Large files Supports files over 4 GiB (uses 64-bit sizes). Supports files over 4 GiB. Does not support files over 4 GiB (32-bit boundary).

2011-04-13(Wed) 編集

[Postgress] Postgressのメモ

su postgres
psql database_name

database_nameというデータベースに接続する.

langridResources=# \d
langridResources=#
langridResources=# \d
langridResources=# DROP TABLE test;
DROP TABLE
langridResources=# \d
langridResources=# DROP TABLE tes;
DROP TABLE
langridResources=# DROP TABLE testtest;
DROP TABLE
langridResources=# DROP TABLE testtest;
ERROR:  テーブル"testtest"は存在しません
langridResources=# \d
langridResources=# \t
タプルのみを表示しています。
langridResources=# \t test
unrecognized boolean value; assuming "on".
タプルのみを表示しています。
langridResources=# \t nkjm
unrecognized boolean value; assuming "on".
タプルのみを表示しています。
langridResources=# select * from resource;

2014-04-13(Sun) 編集

[Apache][mod_rewrite] mod_rewriteによるURLの書きかえ

正規表現(A)は、リライトを実行するかどうかの条件(真偽値)であって、置換 url =~ s/(A)/(D)/ ということではない.

mod_proxyを場当たり的に使ってるので,よく躓く.上のページを見て,少し理解が進んだ.また分からなくなると思うが,自分のケースをメモ.

RewriteEngine on
RewriteBase /event/
RewriteRule ^foo2014$ http://foo.nkjm.info/ [QSA,P,L]
RewriteRule ^foo2014/(.*)$ http://foo.nkjm.info/$1 [QSA,P,L]
  • ^foo2014$にマッチしたらリライトが実行される.QSA(query string append)はクエリ文字列を足す.PはプロキシになりURLが書き換わらない(それに対してRだとリダイレクトになる.mod_rewriteの設定をデバッグするときはRの方が分かりやすい.).Lはこのルールで評価を終了.
  • ^foo2014/(.*)$にマッチしたらリライトが実行される.$1が正規表現の(.*)に置き換わる.

トラブルシューティング

[Tue Apr 01 14:30:23 2014] [warn] proxy: No protocol handler was valid for the URL /world/. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

こんなエラーが出た.Pを指定したのにapacheにproxyに関するモジュールが入っていなかったのが原因の様だった.proxy,proxy_httpをロードするようにしたら解決した.

Debian apache 設定 - OraRailsを参考にした.


トップ «前の日(04-12) 最新 次の日(04-14)» 追記 設定
2006|01|06|12|
2007|06|09|
2008|01|03|04|06|07|08|09|10|12|
2009|01|02|05|06|07|08|10|11|12|
2010|03|04|05|06|07|08|09|10|11|
2011|01|02|03|04|05|06|07|08|09|11|12|
2012|01|02|04|06|07|08|10|11|12|
2013|01|02|03|07|08|10|11|12|
2014|01|02|04|05|06|07|08|09|10|11|
2015|01|02|07|11|12|
2016|01|03|05|07|08|09|