小编Pet*_*val的帖子

Fargate的vCPU究竟是什么意思?

我试图在这里和这里得到我的问题的答案,但我明白我需要特别知道远程控制器的vCPU实现.所以我的问题是:

  1. 如果我为我的任务分配了4个vCPU,这意味着我 在此任务中运行在容器上的单线程应用程序将能够完全使用所有这些vCPU,因为它们基本上只是我可以使用的处理器核心的一部分时间?
  2. 比方说,我为我的任务分配了4vCPU,但在技术层面上,我将4vCPU分配给可以自由处理一个线程的物理核心(甚至更多的超线程处理).我的逻辑是否适用于Fargate案件?

ps这是一个node.js应用程序,它运行会话,多个玩家互相交互,所以我确实希望提供一个具有最大容量的单个 node.js进程.

amazon-web-services aws-ecs aws-fargate

10
推荐指数
2
解决办法
3650
查看次数

在docker容器中重新加载Nginx

我想在我的容器中安装nginx(然后是nodejs).我在nginx /文件夹中有自己的nginx配置文件:

# --- Release with Alpine ----
FROM phusion/baseimage:0.10.1

# Create app directory
WORKDIR /app

RUN apt-get update \
    && apt-get -y install nginx

RUN ls /etc/nginx
COPY nginx/nginx.conf /etc/nginx/nginx.conf
RUN ls /etc/nginx

RUN ls /etc/nginx/sites-enabled
RUN rm /etc/nginx/sites-enabled/default
COPY nginx/serverlogic /etc/nginx/sites-enabled/serverlogic
RUN ls /etc/nginx/sites-enabled

RUN nginx -s reload

RUN echo "$PWD FINALFINALFINAL" && ls

EXPOSE 8080
Run Code Online (Sandbox Code Playgroud)

但我得到一个错误就是RUN nginx -s reload:"nginx:[error] open()"/ run/nginx.pid"失败(2:没有这样的文件或目录)".那是什么?

ps是否在安装了ubuntu,node.js和nginx的docker hub上有一些映像?为简单起见,我想将它们放在一个容器中.

nginx docker

2
推荐指数
1
解决办法
6739
查看次数

两个GetEnumerator方法?

我真的无法理解为什么,在这个例子中,这个类定义了两个GetEnumerator方法:一个显式实现接口,另一个隐式地实现接口.所以为什么?

class FormattedAddresses : IEnumerable<string>
{
    private List<string> internalList = new List<string>();

    public IEnumerator<string> GetEnumerator()
    {
        return internalList.GetEnumerator();
    }

    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
    {
        return internalList.GetEnumerator();
    }

    public void Add(string firstname, string lastname,
                    string street, string city,
                    string state, string zipcode)
    {
        internalList.Add($@"{firstname} {lastname} {street} {city}, {state} {zipcode}");
    }
}
Run Code Online (Sandbox Code Playgroud)

.net c#

2
推荐指数
1
解决办法
64
查看次数

Make class return a field

Is there a way to make a class return one of its fields by default like that:

public class TestClass
{
    public string something;
}

TestClass test = new TestClass();
test = "alpha"; // "alpha" string is assigned to "something"
Console.Write(test); // test returns "alpha" string from "something"
Run Code Online (Sandbox Code Playgroud)

How to make this work?

c# class

2
推荐指数
1
解决办法
89
查看次数

无法理解简单的bash脚本

我是bash脚本的新手,所以我不能真正理解下面这行:

[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
Run Code Online (Sandbox Code Playgroud)

这个双方括号是我猜的if语句.我知道我们将"Host*\n\tStrictHostKeyChecking no \n \n"转换为配置文件,但那里的其他内容是什么.一些文档或新手教程非常感谢.提前致谢!

linux bash

1
推荐指数
1
解决办法
135
查看次数

标签 统计

c# ×2

.net ×1

amazon-web-services ×1

aws-ecs ×1

aws-fargate ×1

bash ×1

class ×1

docker ×1

linux ×1

nginx ×1