• Использовние Redis?

    @denismaster
    Вполне возможно, что следует обратить внимание на внедрение зависимостей, чтобы уберечь код от конструкций вида: new RedisStore();
    А насчет соединений, то можно использовать Dispose-паттерн, а также конструкцию вида using (var store = new RedisStore()) { /*code*/ }
    Тогда соединения должны закрываться автоматически.
    Попробуйте найти в интернете примеры работы с редисом, в том же .NET Core уже были примеры сервисов на его основе.
    Ответ написан
    1 комментарий
  • Какой выбрать mac mini для разработки?

    Главный вопрос: финансовый.
    Если деньги не ограничены - берите новый, по максимуму оперативки и само собой SSD
    Если максимально бюджетно: миник Late 2012 (лучше Intel Core i7 с частотой 2.3 ГГц) + замена HDD на SSD и апгрейд памяти до 16.
    Возможны промежуточные варианты, но SSD и минимум 8 оперативки - обязательно.

    Что забавно, разницы между первым и последним вариантом Вы особо не почувствуете.
    Если не ошибаюсь в миниках Late 2014 память уже идет впаянная, так что с апгрейдом - возможности ограничены.
    Ответ написан
    Комментировать
  • Какой выбрать mac mini для разработки?

    @pr0l
    Пользуюсь mac mini, i5 8gb ram 512gb ssd (менял сам), работать на простом диске отвратно.
    Ответ написан
    Комментировать
  • Как определить machine key который используется по умолчанию?

    DarkRaven
    @DarkRaven
    разработка программного обеспечения
    Можно открыть C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config.comments (в зависимости от установленной версии .NET, путь немного будет меняться)

    Там, есть такое:

    <machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="HMACSHA256" decryption="Auto" compatibilityMode="Framework20SP1" dataProtectorType="" applicationName="" />


    private byte[] _validationKey;
    private byte[] _decryptionKey;
    
    public static byte[] GetKey(object provider, string name)
    {
      var validationKey = provider.GetType().GetMethod(name).Invoke(provider, new object[0]);
      return (byte[])validationKey.GetType().GetMethod("GetKeyMaterial").Invoke(validationKey, new object[0]);
    }
    
    void LoadKeys() // Вызвать для получения ключей
    {
        var machineKey = typeof(MachineKeySection).GetMethods(BindingFlags.Static | BindingFlags.NonPublic).Single(a => a.Name == "GetApplicationConfig").Invoke(null, new object[0]);
    
        var type = Assembly.Load("System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a").GetTypes().Single(a => a.Name == "MachineKeyMasterKeyProvider");
    
        var instance = type.Assembly.CreateInstance(
            type.FullName, false,
            BindingFlags.Instance | BindingFlags.NonPublic,
            null, new object[] { machineKey, null, null, null, null }, null, null);
    
        var validationKey = type.GetMethod("GetValidationKey").Invoke(instance, new object[0]);
        var key = (byte[])validationKey.GetType().GetMethod("GetKeyMaterial").Invoke(validationKey, new object[0]);
    
    
        _validationKey = GetKey(instance, "GetValidationKey");
        _decryptionKey = GetKey(instance, "GetEncryptionKey");
    }


    Взято тут - stackoverflow.com/a/31919794
    Ответ написан
    Комментировать
  • Aws load balancer tcp?

    kamovski
    @kamovski
    Для корректной работы сокетов под балансиром используйте ELBv2, у него интегрирована их полная поддержка. Балансир прекрасно отработает с распределением запросов на любое кол-во инстансов находящихся под его работой, если какие-либо проблемы и могут быть с обработкой параллельных запросов, то причина будет на вашей стороне. Смело ставте его перед серверами и эксперементируйте уже в работе.
    Ответ написан
    1 комментарий
  • Как писать высоко нагруженные приложения web api?

    @dmitryKovalskiy
    программист средней руки
    Как правило вся нагрузка соберется на сервере БД. А там, помимо типа бд, хватит тонкостей даже с банальными выборками. Инструменты? Главная задача - выявлять узкие места. Профилировщик сервера бд к примеру может стать весьма полезен.
    Ответ написан
    Комментировать
  • Как писать высоко нагруженные приложения web api?

    Neuroware
    @Neuroware
    Программист в свободное от работы время
    Советую почитать про микросервисную архитектуру, для высоконагруженных систем самое оно. Насчет инструментов все напрямую зависит от задач, которые перед ней будут ставиться. Про базу аналогично, все зависит от типа используемой БД (SQL\NoSQL) и ее архитектуры.
    Ответ написан
    2 комментария
  • Как работать с windows service?

    artem_b89
    @artem_b89
    Сетевой бездельник
    Пробуйте подключить WinDBG на старте сервиса, собрать дамп и его уже исследовать.
    Сделать это можно как написано тут:
    Configure a service to start with the WinDbg debugger attached
    You can use this method to debug services if you want to troubleshoot service-startup-related problems.
    Configure the "Image File Execution" options. To do this, use one of the following methods:
    Method 1: Use the Global Flags Editor (gflags.exe)
    Start Windows Explorer.
    Locate the gflags.exe file on your computer.

    Note The gflags.exe file is typically located in the following directory: C:\Program Files\Debugging Tools for Windows.
    Run the gflags.exe file to start the Global Flags Editor.
    In the Image File Name text box, type the image name of the process that hosts the service that you want to debug. For example, if you want to debug a service that is hosted by a process that has MyService.exe as the image name, type MyService.exe.
    Under Destination, click to select the Image File Options option.
    Under Image Debugger Options, click to select the Debugger check box.
    In the Debugger text box, type the full path of the debugger that you want to use. For example, if you want to use the WinDbg debugger to debug a service, you can type a full path that is similar to the following: C:\Program Files\Debugging Tools for Windows\windbg.exe
    Click Apply, and then click OK to quit the Global Flags Editor.
    Method 2: Use Registry Editor
    Click Start, and then click Run. The Run dialog box appears.
    In the Open box, type regedit, and then click OK to start Registry Editor.
    Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
    322756 How to back up and restore the registry in Windows

    In Registry Editor, locate, and then right-click the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
    Point to New, and then click Key. In the left pane of Registry Editor, notice that New Key #1 (the name of a new registry subkey) is selected for editing.
    Type ImageName to replace New Key #1, and then press ENTER.

    Note ImageName is a placeholder for the image name of the process that hosts the service that you want to debug. For example, if you want to debug a service that is hosted by a process that has MyService.exe as the image name, type MyService.exe.
    Right-click the registry subkey that you created in step e.
    Point to New, and then click String Value. In the right pane of Registry Editor, notice that New Value #1, the name of a new registry entry, is selected for editing.
    Replace New Value #1 with Debugger, and then press ENTER.
    Right-click the Debugger registry entry that you created in step h, and then click Modify. The Edit String dialog box appears.
    In the Value data text box, type DebuggerPath, and then click OK.

    Note DebuggerPath is a placeholder for the full path of the debugger that you want to use. For example, if you want to use the WinDbg debugger to debug a service, you can type a full path that is similar to the following:
    C:\Progra~1\Debugg~1\windbg.exe

    А также пишите логи, для этого могу рекомендовать log4net.

    Также на хабре были статьи:
    habrahabr.ru/post/127828
    habrahabr.ru/post/89220
    Ответ написан
    Комментировать