サイト環境もろもろ 〜ホスティング編〜

2018/01/01

続いてホスティングに関係する話です。

サーバの構成

ジェネレータに続いてサーバ周りのお話。

なるべく既存サービスに依存せず独立した仕組みを作ろうと思い、サーバも自前で立てることに。1 今回もレンタルサーバを使いました。さくらのVPSです。 思いっきりさくらに依存してるやんと突っ込まれそうですが、 いつでも別サーバにまるっと移行出来るよう一応考えています。

プランは一旦最小構成で整えてみました。

さくらのVPS https://vps.sakura.ad.jp/

  • CPU 仮想1コア
  • SSD 20GB
  • メモリ 512MB
  • 685円/月

スマホやRaspberry Piですらギガ単位のメモリ積んでる時代ですけどね・・・ Xeonプロセッサだし、まあ、まあ。

% cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
stepping	: 4
microcode	: 0x1
cpu MHz		: 2600.002
cache size	: 20480 KB
physical id	: 0
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm xsaveopt vnmi ept fsgsbase tsc_adjust smep erms
bogomips	: 5200.00
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 62
model name	: Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
stepping	: 4
microcode	: 0x1
cpu MHz		: 2600.002
cache size	: 20480 KB
physical id	: 1
siblings	: 1
core id		: 0
cpu cores	: 1
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm xsaveopt vnmi ept fsgsbase tsc_adjust smep erms
bogomips	: 5200.00
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management:

スペックが物足りなければ、 もちろんインスタンスタイプを上げるなり、他に移るなり出来るのですが、 逆にこのインスタンスでどこまで出来るかがこのサイトの目指す所でもあります。

NginxとGitLab CI

前述のとおり静的サイトジェネレータ Jekyll のおかげでサイト全体をGitで管理出来ているので、 セルフホスティングのGitLabにプッシュし、GitLab CIJekyllを動かすようにしています。 GitLabはやはりGitのリポジトリとCIが一元管理出来るところが扱いやすいです。

Webサーバとしては静的サイトなのでフロントにNginxを置いているだけです。 シンプルです。非常にシンプルです。 Webはこれくらいシンプルにあるべきだと思います。 阿部 寛のホームページ 並のレスポンスを目指していきたいです。


  1. たださくらのオブジェクトストレージも興味あるのでしれっと移すかも 

Post Directory